TimeSeriesAnalysis
AIC
Akaike's information criterion
AICc
Akaike's information criterion with sample size correction
BIC
Bayesian information criterion
Calling Sequence
Parameters
Description
Examples
Compatibility
AIC(model, ts, ll)
AICc(model, ts, ll)
BIC(model, ts, ll)
model
-
Exponential smoothing model
ts
Time series consisting of a single data set
ll
(optional) equation of the form loglikelihood = value to pass in a precomputed log likelihood value
Information criteria are functions used to evaluate goodness of fit for a model representing a time series.
The functions take into account both the goodness of fit itself and the number of parameters of the model: a model is better if it fits more closely and if it has fewer parameters.
Akaike's information criterion is defined by
AIC=2⁢k−2⁢l
where k is the number of parameters and l the log likelihood of obtaining the given time series from the given model.
Akaike's information criterion gives very good results if used to evaluate goodness of fit against a large sample size (i.e., a long time series), but for smaller sample sizes a correction is needed. This criterion is obtained as follows:
AICc={2⁢k−2⁢l+2⁢k⁢k+1n−k−1k+1<n∞otherwise
where k and l are as before and n is the size of the sample.
Finally, the Bayesian information criterion is given by
BIC=k⁢log⁡n−2⁢l
where k, l, and n are as above.
The number of parameters of the model is always computed by the information criterion procedure, as is the sample size. The log likelihood can also be computed, but if the log likelihood is known beforehand (e.g. because of running the Optimize command), then it can be passed in using the loglikelihood option. This prevents recomputing the log likelihood and thereby increases efficiency very slightly.
with⁡TimeSeriesAnalysis:
Consider the following time series.
ts≔TimeSeries⁡1.8,3.4,2.1,2.9,2.4,2.9,2.5,3.1,period=2
ts≔Time seriesdata set8 rows of data:2016 - 2023
We create a list of potentially applicable models and optimize them.
models≔Specialize⁡ExponentialSmoothingModel⁡,ts
models≔< an ETS(A,A,A) model >,< an ETS(A,A,N) model >,< an ETS(A,Ad,A) model >,< an ETS(A,Ad,N) model >,< an ETS(A,N,A) model >,< an ETS(A,N,N) model >,< an ETS(M,A,A) model >,< an ETS(M,A,M) model >,< an ETS(M,A,N) model >,< an ETS(M,Ad,A) model >,< an ETS(M,Ad,M) model >,< an ETS(M,Ad,N) model >,< an ETS(M,M,M) model >,< an ETS(M,M,N) model >,< an ETS(M,Md,M) model >,< an ETS(M,Md,N) model >,< an ETS(M,N,A) model >,< an ETS(M,N,M) model >,< an ETS(M,N,N) model >
map⁡Optimize,models,ts
−0.014065563,−5.416379083,0.031961103,−5.145765873,0.002827297,−5.804974813,−0.603105141,−1.517769899,−6.694364663,−0.487294335,−1.376178599,−6.769140123,−0.975463079,−6.912940013,−1.134387223,−6.715408243,−1.772582973,−2.135892023,−6.808173573
We compute Akaike's information criterion for each model.
forminmodelsdoprint⁡m,AIC⁡m,tsenddo
< an ETS(A,A,A) model >,12.01066840
< an ETS(A,A,N) model >,18.83275817
< an ETS(A,Ad,A) model >,13.89411477
< an ETS(A,Ad,N) model >,20.29153175
< an ETS(A,N,A) model >,7.994336806
< an ETS(A,N,N) model >,15.60994963
< an ETS(M,A,A) model >,13.26051935
< an ETS(M,A,M) model >,15.27182966
< an ETS(M,A,N) model >,21.38872933
< an ETS(M,Ad,A) model >,15.51428223
< an ETS(M,Ad,M) model >,16.93433454
< an ETS(M,Ad,N) model >,23.53828025
< an ETS(M,M,M) model >,13.94926348
< an ETS(M,M,N) model >,21.82588003
< an ETS(M,Md,M) model >,16.21600049
< an ETS(M,Md,N) model >,23.43081649
< an ETS(M,N,A) model >,11.54039483
< an ETS(M,N,M) model >,12.29990591
< an ETS(M,N,N) model >,17.61634715
The A,N,A model has the best balance between number of parameters and goodness of fit, according to this criterion, and M,Ad,N the worst.
Because the sample size is rather small, it might be useful to consider the criterion with sample size correction.
forminmodelsdoprint⁡m,AICc⁡m,tsenddo
< an ETS(A,A,A) model >,96.01066840
< an ETS(A,A,N) model >,32.16609150
< an ETS(A,Ad,A) model >,∞
< an ETS(A,Ad,N) model >,50.29153175
< an ETS(A,N,A) model >,21.32767014
< an ETS(A,N,N) model >,18.00994963
< an ETS(M,A,A) model >,97.26051935
< an ETS(M,A,M) model >,99.27182966
< an ETS(M,A,N) model >,34.72206266
< an ETS(M,Ad,A) model >,∞
< an ETS(M,Ad,M) model >,∞
< an ETS(M,Ad,N) model >,53.53828025
< an ETS(M,M,M) model >,97.94926348
< an ETS(M,M,N) model >,35.15921336
< an ETS(M,Md,M) model >,∞
< an ETS(M,Md,N) model >,53.43081649
< an ETS(M,N,A) model >,24.87372816
< an ETS(M,N,M) model >,25.63323924
< an ETS(M,N,N) model >,20.01634715
This time, the A,N,N model does best. Note how some of the models have a value of ∞; this is because they have at least as many parameters as there are sample points.
Alternatively, one can use the Bayesian information criterion; it also corrects for the sample size, but not as strongly as AICc in this case.
forminmodelsdoprint⁡m,BIC⁡m,tsenddo
< an ETS(A,A,A) model >,12.48731765
< an ETS(A,A,N) model >,19.15052434
< an ETS(A,Ad,A) model >,14.45020556
< an ETS(A,Ad,N) model >,20.68873946
< an ETS(A,N,A) model >,8.312102973
< an ETS(A,N,N) model >,15.76883271
< an ETS(M,A,A) model >,13.73716860
< an ETS(M,A,M) model >,15.74847891
< an ETS(M,A,N) model >,21.70649550
< an ETS(M,Ad,A) model >,16.07037302
< an ETS(M,Ad,M) model >,17.49042533
< an ETS(M,Ad,N) model >,23.93548796
< an ETS(M,M,M) model >,14.42591273
< an ETS(M,M,N) model >,22.14364620
< an ETS(M,Md,M) model >,16.77209128
< an ETS(M,Md,N) model >,23.82802420
< an ETS(M,N,A) model >,11.85816099
< an ETS(M,N,M) model >,12.61767207
< an ETS(M,N,N) model >,17.77523023
The Bayesian information criterion also favors the A,N,A model.
The TimeSeriesAnalysis[AIC], TimeSeriesAnalysis[AICc] and TimeSeriesAnalysis[BIC] commands were introduced in Maple 18.
For more information on Maple 18 changes, see Updates in Maple 18.
See Also
Download Help Document