
Akaike information criterion, vectorised (Geron Ch 8, morie.fn hmaic)
Source:R/geron_ml_native.R
morie_geron_aic.RdAIC = -2 log L + 2k, with AICc when n is given and n - k - 1 > 0
(entries where it is not stay NA, as Python leaves them NaN).
best_index is 0-based, as in Python.
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_aic(V, V)
#> $aic
#> [1] 0 0 0 0 0 0 0 0
#>
#> $aicc
#> [1] NA NA NA NA NA NA NA NA
#>
#> $delta
#> [1] 0 0 0 0 0 0 0 0
#>
#> $weights
#> [1] 0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125
#>
#> $best_index
#> [1] 0
#>
#> $k
#> [1] 1 2 3 4 5 6 7 8
#>
#> $estimate
#> [1] 0
#>
#> $n
#> [1] 8
#>
#> $method
#> [1] "Akaike information criterion (AIC = -2 log L + 2k)"
#>