# Investigate Time Series Model Residuals

Having found the model that successfully describes the time series of interest, the fit residual is expected to be a Gaussian white noise process.

Monthly data of accidental deaths in USA from 1973 to 1978.

 In[1]:= Xdeaths = TimeSeries[ ExampleData[{"Statistics", "USAccidentalDeaths"}], {1}];
 In[2]:= XDateListPlot[TimeSeriesRescale[deaths, {"Jan 1973", "Dec 1978"}]]
 Out[2]=

Fit an ARMA model to the data.

 In[3]:= Xtsm1 = TimeSeriesModelFit[deaths, "ARMA"]
 Out[3]=

Autocorrelation, partial autocorrelation, and LjungBox plots suggest correlation at lag 12.

 In[4]:= XTable[Show[tsm1[plot, "LagMax" -> 16], ImageSize -> 175], {plot, {"ACFPlot", "PACFPlot", "LjungBoxPlot"}}]
 Out[4]=

Fit a seasonal ARMA model with seasonality of 12.

 In[5]:= Xtsm12 = TimeSeriesModelFit[deaths, {"SARMA", 12}]
 Out[5]=

ACF, PACF, and LjungBox plots indicate that residuals are likely a white noise.

 In[6]:= XTable[Show[tsm12[plot, "LagMax" -> 32], ImageSize -> 175], {plot, {"ACFPlot", "PACFPlot", "LjungBoxPlot"}}]
 Out[6]=

Selection criteria favor the seasonal model over the non-seasonal one.

 In[7]:= XcritList = {"AIC", "AICc", "BIC", "SBC"}; (#[critList] & /@ {tsm1, tsm12})\[Transpose] // TableForm[#, TableHeadings -> {critList, {"ARMA", Subscript["SARMA", 12]}}] &
 Out[7]//TableForm=

## Mathematica + Mathematica Online

Questions? Comments? Contact a Wolfram expert »