First Steps in Time Series Analysis
By: Aayush Ostwal
Tags: Machine Learning, Deep Learning, AI, Time Series Analysis

From the point of time we came to know that data contains trends and we can extract knowledge from it, we started collecting it. In some instances, we try to generate trends from data where the time is not so large. Hence we do not find any trend concerning time.

But now, after decades of data collection, we can find at least some patterns with respect time and this is called a Time Series analysis.

What is a Time Series?

A series of observations recorded sequentially over a while i.e. a collection of observations recorded along with the timestamp is called a Time series.

Representation

Representation of Time series

The variable of interest can be univariate i.e. single variable or multivariate i.e. collection of variables.

The oldest Time Series

The solar cycle or solar magnetic activity cycle is a nearly periodic 11-year change in the sun’s activity measured in terms of variations in the number of observed sunspots on the solar surface hence around 400 years old. This observed data have been collected since the 17th century.

Dominant features in a Time Series

There are four major dominant features can be found in a time series

Time Trend Component:

It is the long term, smooth characteristics of a time series are called the time trend component. Seasonal Variation Component:

The patterns of change in a time series within a year which tends to repeat each year is called the seasonal component. Long term Cyclic Variation:

The rise and fall of a time series over periods longer than one year are called Long term cyclic variation. Irregular Variation:

It is the random stochastic component of a time series.

The first three trends are called the Deterministic Components hence can be determined by conventional methods, and the irregular component is called the Stochastic Component, which we need to estimate or fit a model.

We use various techniques like the Statistical Hypothesis testing approach for testing the existence of the components and estimation of significant components.

Decomposition of a Time Series

We use various methods to decompose a time series into a time trend, seasonal trend, and the stochastic trend. The decomposition look likes:

Decomposition of a time series; Source: otexts.com/

Trend Decomposition:

We use techniques like a simple moving average to smoothen the time series and obtain a time trend. For more complex and advanced time series we can use an extension of a weighted moving average or exponential moving average.

We can also use the least square fitting for generalizing the time trend as a single straight line or can use even more complex functions like quadratic or cubic to fit the data.

A: Simple Moving Average, B: Weighted Moving Average, C: Least square fitting

Seasonal Decomposition:

The estimation of the seasonal component depends on whether the trend is present or not. In the case the trend is present, we first estimate the trend (slow or fast-changing) and then seasonal factors are extracted from the de-trended times series.

Forms of Stationarity

Process Specification:

To describe a stochastic process completely, we must specify all the finite-dimensional distributions, i.e. the joint distribution of the random variables for any finite set of time points.

A simpler approach is to only specify the moments of the underlying random process i.e the mean and the variance of the time series.

Auto Covariance Function:

As the random variables comprising the system are usually not independent ie. they are observed sequentially over time. Hence, we must also specify their covariance to extract the time dependence structure.

ACF: Auto Covariance Function

Stationarity

It is defined as the statistical equilibrium of a time series over time. There are two types of stationarity

Strict Stationarity

Where the joint distribution function of any collection of random variables does not change with location shift. There is neither systematic change in mean nor variability. Analysis and modeling require the time series to be stationary. Weak or Covariance Stationarity

Where the mean and autocovariance functions do not depend on time points of reference.

Summing Up

This was a very fine overview of what a time series is? What are its components? What type of analysis are possible? and a brief introduction to 400 years old-time series.

This article gives more of a theoretical understanding rather than mathematical tools of analyzing a Time series. Accordingly, I would like to deliver a few more articles on the theoretical understanding of Time series and the fun maths behind it.