πŸŽ‰ 75% of content is free forever β€” Unlock Premium from $10/mo β†’
CW
Search courses…
πŸ’Ό Servicesℹ️ Aboutβœ‰οΈ ContactView Pricing Plansfrom $10

Time Series Analysis

StatisticsTime Series🟒 Free Lesson

Advertisement

Time Series Analysis

Why It Matters

Time series appear everywhere: stock prices, sensor data, user traffic, weather records, GDP growth. Unlike cross-sectional data, time series have temporal structure β€” trends, seasonality, and autocorrelation β€” that requires specialized methods. Understanding these patterns is crucial for forecasting, anomaly detection, and understanding dynamic systems. Ignoring temporal structure leads to invalid inference and poor predictions.


Overview

A time series decomposes into four components: trend (long-term direction), seasonality (fixed-period patterns like daily or yearly cycles), cyclical (irregular long-term fluctuations), and noise (random variation). Most time series methods require stationarity β€” constant mean and variance over time. The ADF test checks for a unit root (non-stationarity). The ARIMA framework applies differencing to achieve stationarity, autoregressive terms to capture dependence on past values, and moving-average terms to capture dependence on past errors. ACF/PACF plots guide model order selection. Once fitted, the model extrapolates future values, but confidence intervals widen with forecast horizon.


Key Concepts

ARIMA(p, d, q) Model

Ο•(B)(1βˆ’B)dXt=ΞΈ(B)Ο΅t\phi(B)(1-B)^d X_t = \theta(B)\epsilon_t

Here,

  • Ο•(B)\phi(B)=Autoregressive polynomial: $1 - \phi_1 B - \cdots - \phi_p B^p$
  • (1βˆ’B)d(1-B)^d=Differencing operator of order d
  • ΞΈ(B)\theta(B)=Moving average polynomial: $1 + \theta_1 B + \cdots + \theta_q B^q$
  • Ο΅t\epsilon_t=White noise error: $\epsilon_t \sim N(0, \sigma^2)$

Backshift Operator

BXt=Xtβˆ’1,BkXt=Xtβˆ’kB X_t = X_{t-1}, \quad B^k X_t = X_{t-k}

Here,

  • BB=Backshift (lag) operator

AR(1) Model

Xt=Ο•Xtβˆ’1+Ο΅tX_t = \phi X_{t-1} + \epsilon_t

Here,

  • Ο•\phi=Autoregressive coefficient; $|\phi| < 1$ for stationarity

MA(1) Model

Xt=Ο΅t+ΞΈΟ΅tβˆ’1X_t = \epsilon_t + \theta \epsilon_{t-1}

Here,

  • ΞΈ\theta=Moving average coefficient

Exponential Smoothing (Simple)

X^t+1=Ξ±Xt+(1βˆ’Ξ±)X^t\hat{X}_{t+1} = \alpha X_t + (1-\alpha)\hat{X}_t

Here,

  • Ξ±\alpha=Smoothing parameter ($0 < \alpha < 1$)

Time Series Components

ComponentDescriptionExample
TrendLong-term directionIncreasing user base
SeasonalityFixed-period patternDaily traffic peaks at noon
CyclicalIrregular long-term swingsBusiness cycles (years)
NoiseRandom variationWeather fluctuations

ACF/PACF Pattern Guide

ModelACF PatternPACF Pattern
AR(p)Tails off (exponential/sinusoidal)Cuts off after lag p
MA(q)Cuts off after lag qTails off
ARMA(p,q)Tails offTails off

Quick Example

Interpreting ADF Test

ADF test on a time series: statistic = -1.2, p-value = 0.85.

Cannot reject the null of a unit root. The series is non-stationary. Apply differencing (dβ‰₯1d \geq 1 in ARIMA) until the ADF p-value < 0.05.

After first differencing: ADF statistic = -4.5, p-value = 0.001. Now stationary β€” use ARIMA with d=1d = 1.

ARIMA Order Selection

ACF cuts off after lag 1 -> MA(1). PACF cuts off after lag 2 -> AR(2). ACF tails off, PACF cuts off after lag 2 -> AR(2). Use AIC to choose between competing models β€” lower AIC = better fit penalized for complexity.


Key Takeaways

Summary: Time Series Analysis

  • Four Components: Trend, seasonality, cyclical, noise. Identifying these guides model selection.
  • Stationarity: Required for most models. Constant mean and variance over time. Test with ADF test.
  • ARIMA: AR (autoregressive lags) + I (differencing for stationarity) + MA (moving average of errors). Select order via ACF/PACF or AIC.
  • Backshift Operator: BXt=Xtβˆ’1B X_t = X_{t-1} simplifies notation. (1βˆ’B)d(1-B)^d removes trends of order dd.
  • Forecasting: Extrapolate with forecast(steps=10), but confidence intervals widen with horizon β€” shorter forecasts are more reliable.
  • Workflow: Plot series -> test stationarity -> difference if needed -> identify ARIMA order -> fit -> validate residuals -> forecast.
  • Seasonal Extension: SARIMA adds seasonal AR, I, and MA terms for periodic patterns.

Deep Dive

For detailed explanations, worked examples, and Python implementations, explore the dedicated statistics lessons:

Stationarity

Model Identification

  • ACF and PACF β€” Autocorrelation and partial autocorrelation functions for identifying ARIMA order with examples

ARIMA Models

  • ARIMA Models β€” Fitting, diagnostics, forecasting, order selection, and Python implementation

Seasonal Models

  • Seasonal Decomposition β€” STL decomposition, seasonal patterns, trend estimation, and decomposition methods

Smoothing Methods

  • Exponential Smoothing β€” Simple, double, and triple (Holt-Winters) exponential smoothing for forecasting

Causality

Related Topics

⭐

Premium Content

Time Series Analysis

Unlock this lesson and 900+ advanced tutorials with a Premium plan.

🎯End-to-end Projects
πŸ’ΌInterview Prep
πŸ“œCertificates
🀝Community Access

Already a member? Log in

Need Expert Mathematics Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement