Time Series Analysis

Last updated: December 2024

Disclaimer: These are my personal notes compiled for my own reference and learning. They may contain errors, incomplete information, or personal interpretations. While I strive for accuracy, these notes are not peer-reviewed and should not be considered authoritative sources. Please consult official textbooks, research papers, or other reliable sources for academic or professional purposes.

1. Introduction

Time series analysis deals with data points collected over time. The key characteristic is that observations are not independent.

2. Stationarity

A time series $\{X_t\}$ is weakly stationary if:

3. Autocorrelation Function (ACF)

The autocorrelation function is defined as:

$$\rho(h) = \frac{\gamma(h)}{\gamma(0)} = \frac{Cov(X_t, X_{t+h})}{Var(X_t)}$$

4. ARIMA Models

ARIMA$(p,d,q)$ models combine:

The general form is:

$$\phi(B)(1-B)^d X_t = \theta(B)\epsilon_t$$

where $\phi(B)$ and $\theta(B)$ are polynomials in the backshift operator $B$.

5. Model Selection

Use AIC (Akaike Information Criterion) for model selection:

$$AIC = 2k - 2\ln(L)$$

where $k$ is the number of parameters and $L$ is the likelihood.

6. Forecasting

For ARIMA$(1,1,1)$ model, the forecast equation is:

$$\hat{X}_{t+1} = X_t + \phi_1(X_t - X_{t-1}) + \theta_1\epsilon_t$$

7. Code Example

# R code for ARIMA modeling
library(forecast)

# Fit ARIMA model
model <- auto.arima(ts_data)
summary(model)

# Forecast
forecast(model, h=12)

8. References