%% Compare AIC Statistics
% Calculate and interpret the AIC for four models.
% The loglikelihood function values (logL) and the number of model parameters (numParam) from four multivariate time series analyses are:

logL1 = -681.4724;
logL2 = -632.3158;
logL3 = -663.4615;
logL4 = -605.9439;

numParam1 = 12;
numParam2 = 27;
numParam3 = 18;
numParam4 = 45;

%
% Calculate the AIC.

aic = aicbic([logL1,logL2,logL3,logL4], ...
    [numParam1,numParam2,numParam3,numParam4])

% The model with the lowest AIC has the best fit. Therefore, the fourth model fits best.
% Copyright 2015 The MathWorks, Inc.