Skip to contents

Formula: AIC(p) = log(sigmahat_p^2) + 2(p+1)/T, sigmahat_p^2 from the Levinson-Durbin recursion

Usage

Aicar(x, max_p = 10, demean = TRUE)

Arguments

x

See Usage.

max_p

See Usage.

demean

See Usage.

Value

List with p, aic, aic_unnormalised, sigma2, pacf, n.

References

Akaike (1973), Information theory and an extension of the maximum likelihood principle, in Petrov and Csaki (eds), 2nd International Symposium on Information Theory. AIC = -2 log L + 2k and its AR(p) specialisation via the Levinson-Durbin innovation variance are the standard published forms.

Examples

set.seed(1)
x <- as.numeric(filter(rnorm(100), 0.5, method = "recursive"))
Aicar(x, max_p = 5)
#> $p
#> [1] 1
#> 
#> $aic
#> [1]  0.008905843 -0.180561334 -0.172146359 -0.174859823 -0.166677925
#> [6] -0.151389670
#> 
#> $aic_unnormalised
#> [1]   0.8905843 -18.0561334 -17.2146359 -17.4859823 -16.6677925 -15.1389670
#> 
#> $sigma2
#> [1] 0.9889672 0.8020684 0.7928301 0.7750251 0.7659197 0.7623194
#> 
#> $pacf
#> [1]  0.43472260 -0.10732277 -0.14985812 -0.10839069 -0.06856138
#> 
#> $n
#> [1] 100
#> 
#> $method
#> [1] "AIC order selection for AR(p)"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"