Quantcast

Documentation Center

  • Trial Software
  • Product Updates

Check Fit of Multiplicative ARIMA Model

This example shows how to do goodness of fit checks. Residual diagnostic plots help verify model assumptions, and cross-validation prediction checks help assess predictive performance. The time series is monthly international airline passenger numbers from 1949 to 1960.

Step 1. Load the data and estimate a model.

Load the airline data set.

load(fullfile(matlabroot,'examples','econ','Data_Airline.mat'))
Y = log(Dataset.PSSG);
N = length(Y);

model = arima('Constant',0,'D',1,'Seasonality',12,...
              'MALags',1,'SMALags',12);
fit = estimate(model,Y);
 
    ARIMA(0,1,1) Model Seasonally Integrated with Seasonal MA(12):
    ---------------------------------------------------------------
    Conditional Probability Distribution: Gaussian

                                  Standard          t     
     Parameter       Value          Error       Statistic 
    -----------   -----------   ------------   -----------
     Constant              0         Fixed          Fixed
        MA{1}      -0.377162     0.0667944       -5.64661
      SMA{12}      -0.572378     0.0854395       -6.69923
     Variance     0.00126337    0.00012395        10.1926

Step 2. Check the residuals for normality.

One assumption of the fitted model is that the innovations follow a Gaussian distribution. Infer the residuals, and check them for normality.

res = infer(fit,Y);
stres = res/sqrt(fit.Variance);

figure
subplot(1,2,1)
qqplot(stres)

x = -4:.05:4;
[f,xi] = ksdensity(stres);
subplot(1,2,2)
plot(xi,f,'k','LineWidth',2);
hold on
plot(x,normpdf(x),'r--','LineWidth',2)
legend('Standardized Residuals','Standard Normal')
hold off

The quantile-quantile plot (QQ-plot) and kernel density estimate show no obvious violations of the normality assumption.

Step 3. Check the residuals for autocorrelation.

Confirm that the residuals are uncorrelated. Look at the sample autocorrelation function (ACF) and partial autocorrelation function (PACF) plots for the standardized residuals.

figure
subplot(2,1,1)
autocorr(stres)
subplot(2,1,2)
parcorr(stres)

[h,p] = lbqtest(stres,'lags',[5,10,15],'dof',[3,8,13])
h =

     0     0     0


p =

    0.1842    0.3835    0.7321

The sample ACF and PACF plots show no significant autocorrelation. More formally, conduct a Ljung-Box Q-test at lags 5, 10, and 15, with degrees of freedom 3, 8, and 13, respectively. The degrees of freedom account for the two estimated moving average coefficients.

The Ljung-Box Q-test confirms the sample ACF and PACF results. The null hypothesis that all autocorrelations are jointly equal to zero up to the tested lag is not rejected (h = 0) for any of the three lags.

Step 4. Check predictive performance.

Use a holdout sample to compute the predictive MSE of the model. Use the first 100 observations to estimate the model, and then forecast the next 44 periods.

Y1 = Y(1:100);
Y2 = Y(101:end);

fit1 = estimate(model,Y1);
Yf1 = forecast(fit1,44,'Y0',Y1);
PMSE = mean((Y2-Yf1).^2)

figure
plot(Y2,'r','LineWidth',2)
hold on
plot(Yf1,'k--','LineWidth',1.5)
xlim([0,44])
title('Prediction Error')
legend('Observed','Forecast','Location','NorthWest')
hold off
 
    ARIMA(0,1,1) Model Seasonally Integrated with Seasonal MA(12):
    ---------------------------------------------------------------
    Conditional Probability Distribution: Gaussian

                                  Standard          t     
     Parameter       Value          Error       Statistic 
    -----------   -----------   ------------   -----------
     Constant              0         Fixed          Fixed
        MA{1}      -0.356736      0.089461       -3.98762
      SMA{12}      -0.633186     0.0987442       -6.41239
     Variance     0.00132855   0.000158823        8.36497

PMSE =

    0.0069

The predictive ability of the model is quite good. You can optionally compare the PMSE for this model with the PMSE for a competing model to help with model selection.

See Also

| | | | | |

Related Examples

More About

Was this topic helpful?