Last modified: January 27, 2025

This article is written in: 🇺🇸

ARMA, ARIMA and SARIMA Models

ARMA, ARIMA, and SARIMA are models commonly used to analyze and forecast time series data. ARMA (AutoRegressive Moving Average) combines two ideas: using past values to predict current ones (autoregression) and smoothing out noise using past forecast errors (moving average). ARIMA (AutoRegressive Integrated Moving Average) builds on ARMA by adding a step to handle trends in non-stationary data through differencing. SARIMA (Seasonal ARIMA) takes it a step further by accounting for repeating seasonal patterns. These models are practical and versatile for working with time series data that show trends, noise, or seasonal effects.

Autoregressive Moving Average (ARMA) Models

ARMA models combine autoregressive (AR) and moving average (MA) components to model time series data exhibiting both autocorrelation and serial dependence.

Mathematical Definition of ARMA Models

An ARMA(p,q) model is defined by:

Xt=c+i=1pϕiXti+ϵt+j=1qθjϵtj

or, equivalently, using the backshift operator B:

ϕ(B)Xt=c+θ(B)ϵt

where:

Stationarity of AR Processes

An AR(p) process is stationary if all the roots of the characteristic polynomial ϕ(B)=0 lie outside the unit circle in the complex plane. This condition ensures that the time series has a constant mean and variance over time.

Invertibility of MA Processes

An MA(q) process is invertible if all the roots of θ(B)=0 lie outside the unit circle. Invertibility allows the MA process to be expressed as an infinite AR process, ensuring a unique representation and facilitating parameter estimation.

Infinite Order Representations

AR(∞) Representation of MA Processes:

An MA process can be expressed as an infinite-order AR process:

Xt=k=1πkXtk+ϵt

MA(∞) Representation of AR Processes:

An AR process can be expressed as an infinite-order MA process:

Xt=k=0ψkϵtk

Example: ARMA(1,1) Process

Consider the ARMA(1,1) model:

Xt=ϕXt1+ϵt+θϵt1

Let ϕ=0.7, θ=0.2, and ϵt is white noise.

Simulation

To analyze this process, we simulate a large number of observations using statistical software (e.g., R or Python) to approximate its properties.

set.seed(500)
data <- arima.sim(n = 1e6, list(ar = 0.7, ma = 0.2))

Converting ARMA to Infinite Order Processes

AR(∞) Representation:

(1ϕB)Xt=(1+θB)ϵt

Xt=(1ϕB)1(1+θB)ϵt

Xt=[1+ϕB+ϕ2B2+](1+θB)ϵt

Multiplying the series:

Xt=[1+(ϕ+θ)B+(ϕ2+ϕθ)B2+]ϵt

MA(∞) Representation:

Xt=1+θB1ϕBϵt=[1+ψ1B+ψ2B2+]ϵt

Calculating ψ coefficients:

ψk=ϕk+θϕk1

Theoretical Autocorrelations

The autocorrelation function (ACF) for an ARMA(1,1) process is:

ρk=ϕk(1+ϕθ1+2ϕθ+θ2)

Calculations:

ρ1=0.7(1+0.7×0.21+2×0.7×0.2+0.22)0.777

ρ2=0.7×ρ10.544

ρ3=0.7×ρ20.381

Results and Interpretation

Autoregressive Integrated Moving Average (ARIMA) Models

ARIMA models generalize ARMA models to include differencing, allowing them to model non-stationary time series data.

Mathematical Definition of ARIMA Models

An ARIMA(p,d,q) model is defined by:

ϕ(B)(1B)dXt=c+θ(B)ϵt

where:

Determining Differencing Order

Fitting ARIMA Models: Numerical Example

Suppose we have a time series Xt exhibiting an upward trend.

Step 1: Differencing

First-order differencing is applied to achieve stationarity:

Yt=(1B)Xt=XtXt1

Step 2: Model Identification

Analyzing the differenced series Yt:

Assume ACF suggests MA(1) and PACF suggests AR(1).

Step 3: Parameter Estimation

Fit an ARIMA(1,1,1) model:

(1ϕB)(1B)Xt=c+(1+θB)ϵt

Estimate ϕ, θ, and c using MLE.

Step 4: Model Diagnostics
Step 5: Forecasting

Use the fitted model to forecast future values:

$$\hat{X}{t+h} = c + \phi \hat{X}{t+h-1} + \theta \hat{\epsilon}_{t+h-1}$$

Seasonal ARIMA Processes (SARIMA)

Seasonal ARIMA (SARIMA) models are widely used for time series data exhibiting both trend and seasonal behaviors.

Mathematical Formulation

A SARIMA(p,d,q×P,D,Q)s model incorporates both non-seasonal and seasonal factors:

ΦP(Bs)ϕp(B)(1Bs)D(1B)dXt=ΘQ(Bs)θq(B)ϵt

Non-seasonal components in time series models include several terms:

Seasonal components extend these concepts to capture repeating patterns:

The backshift operator is used to reference previous values in the series:

Examples of SARIMA Models

Example 1: SARIMA(1, 0, 0)(1, 0, 0)12

Model Equation:

(1ϕ1B)(1Φ1B12)Xt=ϵt

Example 2: SARIMA(0, 1, 1)(0, 1, 1)4

Model Equation:

(1B)(1B4)Xt=(1+θ1B)(1+Θ1B4)ϵt

Simplification and Expansion

Non-seasonal Differencing:

(1B)Xt=XtXt1

Seasonal Differencing:

(1Bs)Xt=XtXts

Combining Differencing:

(1B)(1Bs)Xt=XtXt1Xts+Xts1

Stationarity and Invertibility Conditions

Seasonal Differencing

First-order Seasonal Differencing:

sXt=XtXts

Second-order Seasonal Differencing:

s2Xt=Xt2Xts+Xt2s

Autocorrelation Function (ACF) of SARIMA Processes

The ACF of a SARIMA model displays patterns reflecting both seasonal and non-seasonal behavior.

Example: SARIMA(0, 0, 1)(0, 0, 1)12

Model Specification:

Xt=ϵt+θ1ϵt1+Θ1ϵt12+θ1Θ1ϵt13

Parameters:

Error Term:

ϵt: White noise with mean zero and variance σ2

Calculating Autocovariances

I. Variance (γ0):

γ0=Var(Xt)=σ2(1+θ12+Θ12+θ12Θ12)

II. Covariance at Lag 1 (γ1):

γ1=Cov(Xt,Xt1)=σ2θ1(1+Θ12)

III. Covariance at Lag 12 (γ12):

γ12=σ2Θ1(1+θ12)

IV. Covariance at Lag 13 (γ13):

γ13=σ2θ1Θ1(1+θ1Θ1)

Calculating Autocorrelations

ACF at Lag k:

ρk=γkγ0

Example: Monthly Airline Passenger Data

Consider a time series consisting of monthly airline passenger data. This particular time series is characterized by two distinct features: an upward trend indicating an increase in the number of passengers over time, and a seasonal pattern that repeats every 12 months, typically linked to factors such as holiday travel or seasonal tourism.

Steps to Model and Forecast the Time Series:

I. Decompose the Time Series into Trend, Seasonal, and Residual Components:

II. Detrend the Time Series Using Differencing or Transformation:

III. Fit an Appropriate Model that Accounts for Both Trend and Seasonality:

IV. Forecast Future Values Using the Fitted Model:

seasonality_forecast

Table of Contents

    ARMA, ARIMA and SARIMA Models
    1. Autoregressive Moving Average (ARMA) Models
      1. Mathematical Definition of ARMA Models
      2. Stationarity of AR Processes
      3. Invertibility of MA Processes
      4. Infinite Order Representations
      5. Example: ARMA(1,1) Process
    2. Autoregressive Integrated Moving Average (ARIMA) Models
      1. Mathematical Definition of ARIMA Models
      2. Determining Differencing Order
      3. Fitting ARIMA Models: Numerical Example
    3. Seasonal ARIMA Processes (SARIMA)
      1. Mathematical Formulation
      2. Examples of SARIMA Models
      3. Stationarity and Invertibility Conditions
      4. Seasonal Differencing
      5. Autocorrelation Function (ACF) of SARIMA Processes
      6. Example: Monthly Airline Passenger Data