Akaike or Bayesian information criteria - MATLAB aicbic aicbic Akaike or Bayesian information criteria Syntax aic = aicbic(logL,numParam) [aic,bic] = aicbic(logL,numParam,numObs) Description aic = aicbic(logL,numParam) returns Akaike information criteria (AIC) corresponding to optimized loglikelihood function values (logL), as returned by estimate, and the model parameters, numParam. [aic,bic] = aicbic(logL,numParam,numObs) additionally returns Bayesian information criteria (BIC) corresponding to logL, numParam, and the sample sizes associated with each logL value. Examples example example collapse all 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 logL2 logL3 logL4 = = = = Try This Example View MATLAB Command -681.4724; -632.3158; -663.4615; -605.9439; numParam1 numParam2 numParam3 numParam4 = = = = 12; 27; 18; 45; Calculate the AIC. aic = aicbic([logL1,logL2,logL3,logL4], ... [numParam1,numParam2,numParam3,numParam4]) aic = 1×4 103 × 1.3869 1.3186 1.3629 1.3019 The model with the lowest AIC has the best fit. Therefore, the fourth model fits best. 1 Akaike or Bayesian information criteria - MATLAB aicbic Information Criteria Statistics for Simulated Data Compare information criteria statistics for several model fits. Specify the model Try This Example View MATLAB Command where is Gaussian with mean 0 and variance 2. Simulate data from this model. rng(1); % For random data reproducibility T = 100; % Sample size DGP = arima('Constant',-4,'AR',[0.2, 0.5], ... 'Variance',2); y = simulate(DGP,T); Define three competing models to fit to the data. EstMdl1 = arima('ARLags',1); EstMdl2 = arima('ARLags',1:2); EstMdl3 = arima('ARLags',1:3); Fit the models to the data. logL = zeros(3,1); % Preallocate loglikelihood vector [~,~,logL(1)] = estimate(EstMdl1,y,'Display','off'); [~,~,logL(2)] = estimate(EstMdl2,y,'Display','off'); [~,~,logL(3)] = estimate(EstMdl3,y,'Display','off'); Compute the AIC and BIC for each model. [aic,bic] = aicbic(logL, [3; 4; 5], T*ones(3,1)) aic = 3×1 381.7732 358.2422 358.8479 bic = 3×1 389.5887 368.6629 371.8737 The model containing two autoregressive lag parameters fits best since it yields the lowest information criteria. The structure of the best fitting model matches the model structure that simulated the data. Input Arguments 2 Akaike or Bayesian information criteria - MATLAB aicbic logL — Optimized loglikelihood values scalar | vector Optimized loglikelihood objective function values associated with various model fits, specified as a scalar or vector. Obtain an optimized loglikelihood value using estimate, infer, estimate, or an Optimization Toolbox™ function such as fmincon or fminunc. Data Types: double | single numParam — Number of estimated parameters scalar | vector Number of estimated parameters associated with each corresponding fitted model in logL, specified as a positive integer, or a vector of positive integers having the same length as logL. If numParam is a scalar, then aicbic applies it to all logL values. For univariate time series models, use length(info.X) to obtain numParam from a fitted model returned by estimate. For VAR models, obtain numParam using summarize from an estimated varm model object. Data Types: double | single numObs — Sample sizes scalar | vector Sample sizes of the observed series associated with each corresponding fitted model in logL, specified as a positive integer, or a vector of positive integers having the same length as logL. aicbic requires numObs to compute the BIC. If numObs is a scalar, then aicbic applies it to all logL values. Data Types: double | single Output Arguments collapse all aic — AIC statistics scalar | vector AIC statistics associated with each corresponding fitted model in logL, returned as a vector with the same length as logL. bic — BIC statistics 3 Akaike or Bayesian information criteria - MATLAB aicbic scalar | vector BIC statistics associated with each corresponding fitted model in logL, returned as a vector with the same length as logL. More About collapse all Akaike Information Criterion A model fit statistic considers goodness-of-fit and parsimony. Select models that minimize AIC. When comparing multiple model fits, additional model parameters often yield larger, optimized loglikelihood values. Unlike the optimized loglikelihood value, AIC penalizes for more complex models, i.e., models with additional parameters. The formula for AIC, which provides insight into its relationship to the optimized loglikelihood and its penalty for complexity, is: Bayesian Information Criterion A model fit statistic considers goodness-of-fit and parsimony. Select models that minimize BIC. Like AIC, BIC uses the optimal loglikelihood function value and penalizes for more complex models, i.e., models with additional parameters. The penalty of BIC is a function of the sample size, and so is typically more severe than that of AIC. The formula for BIC is: References [1] Box, G. E. P., G. M. Jenkins, and G. C. Reinsel. Time Series Analysis: Forecasting and Control. 3rd ed. Englewood Cliffs, NJ: Prentice Hall, 1994. See Also Objects arima | garch | regARIMA | varm Functions estimate | estimate | estimate | estimate | fmincon | fminunc | infer | lmtest | waldtest Topics Information Criteria Time Series Regression V: Predictor Selection Determine Minimal Number of Lags Using Information Criterion 4 Akaike or Bayesian information criteria - MATLAB aicbic Choose ARMA Lags Using BIC Compare Conditional Variance Models Using Information Criteria VAR Model Case Study Introduced before R2006a 5