# 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:= Xdeaths = TimeSeries[ ExampleData[{"Statistics", "USAccidentalDeaths"}], {1}];
 In:= XDateListPlot[TimeSeriesRescale[deaths, {"Jan 1973", "Dec 1978"}]]
 Out= Fit an ARMA model to the data.

 In:= Xtsm1 = TimeSeriesModelFit[deaths, "ARMA"]
 Out= Autocorrelation, partial autocorrelation, and LjungBox plots suggest correlation at lag 12.

 In:= XTable[Show[tsm1[plot, "LagMax" -> 16], ImageSize -> 175], {plot, {"ACFPlot", "PACFPlot", "LjungBoxPlot"}}]
 Out= Fit a seasonal ARMA model with seasonality of 12.

 In:= Xtsm12 = TimeSeriesModelFit[deaths, {"SARMA", 12}]
 Out= ACF, PACF, and LjungBox plots indicate that residuals are likely a white noise.

 In:= XTable[Show[tsm12[plot, "LagMax" -> 32], ImageSize -> 175], {plot, {"ACFPlot", "PACFPlot", "LjungBoxPlot"}}]
 Out= Selection criteria favor the seasonal model over the non-seasonal one.

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

Questions? Comments? Contact a Wolfram expert »