Univariate Time Series Analysis

Kevin Sheppard

Seasonality

  • A seasonal time series has a deterministic pattern that repeats on an annual basis
In [5]:
plot(housing, y=-2)

Seasonal Autocorrelation Pattern

  • Seasonal data has dynamics at the annual frequency
In [6]:
acf_pacf_plot(housing, 24, size=-2)

Seasonal Differencing

  • Seasonal differencing differences using the seasonal period $s$
$$ \Delta_{s} Y_t = Y_t - Y_{t-s} $$
  • Can reduce or eliminate seasonalities
In [7]:
plot(housing_yoy, y=12)

Seasonal Difference Autocorrelation Pattern

In [8]:
acf_pacf_plot(housing_yoy, 24)

Modeling Seasonal Differences

In [9]:
res = SARIMAX(housing_yoy, order=(1, 0, 0)).fit()
resids = res.resid.iloc[1:]
acf_pacf_plot(resids, 24, size=-2)

Seasonal ARMA Models

  • SARMA models data at both the observational and seasonal frequency
  • In lag polynomial representation
$$ (1-\phi_1 L -\phi_2 L^2) Y_t = \phi_0 + (1+\theta_s L^s)\epsilon_t $$
  • In standard ARMA representation
$$ Y_t = \phi_0 + \phi_1 Y_{t-1} +\phi_2 Y_{t-2} + \theta_s \epsilon_{t-s} + \epsilon_t $$$$ \text{SARMA}(P,0,Q)\times(P_s,0,Q_s,s) $$
In [10]:
res = SARIMAX(housing_yoy, order=(2, 0, 0), seasonal_order=(0, 0, 1, 12)).fit()
summary(res)
coef std err z P>|z| [0.025 0.975]
ar.L1 0.6809 0.034 20.284 0.000 0.615 0.747
ar.L2 0.2824 0.034 8.233 0.000 0.215 0.350
ma.S.L12 -0.8795 0.017 -50.520 0.000 -0.914 -0.845
sigma2 0.0083 0.000 21.791 0.000 0.008 0.009

SARMA Residual Diagnostics

In [11]:
acf_pacf_plot(res.resid.iloc[13:], 24)

Extended Dynamics $(1,0,1)\times(1,0,1)_{12}$

  • In lag polynomial representation
$$ (1-\phi_1 L)(1-\phi_s L^s)Y_t = \phi_0 + (1+\theta_1 L)(1+\theta_s L^s)\epsilon_t $$
  • In standard ARMA representation
$$ Y_t = \phi_0 + \phi_1 Y_{t-1} +\phi_s Y_{t-s} - \phi_1\phi_s Y_{t-s-1} + \theta_1 \epsilon_{t-1} +\theta_s \epsilon_{t-s} + \theta_1\theta_s \epsilon_{t-s-1} + \epsilon_t $$
In [12]:
res = SARIMAX(housing_raw, order=(1, 0, 1), seasonal_order=(1, 0, 1, 12)).fit()
summary(res)
coef std err z P>|z| [0.025 0.975]
ar.L1 0.9994 0.001 1441.218 0.000 0.998 1.001
ma.L1 -0.3196 0.031 -10.367 0.000 -0.380 -0.259
ar.S.L12 0.9987 0.001 1469.955 0.000 0.997 1.000
ma.S.L12 -0.8957 0.016 -54.402 0.000 -0.928 -0.863
sigma2 0.0083 0.000 22.277 0.000 0.008 0.009

Extended Model Residual Diagnostics

In [13]:
acf_pacf_plot(res.resid.iloc[13:], 24)