Akaike's An Information Criterion for an object of class modeler
Source: R/08_comparison.R
goodness_of_fit.Rd
Generic function calculating Akaike's ‘An Information Criterion’
for fitted model object of class modeler
.
Arguments
- object
An object inheriting from class
modeler
resulting of executing the functionmodeler()
- ...
Further parameters. For future improvements.
- k
Numeric, the penalty per parameter to be used; the default k = 2 is the classical AIC.
Examples
library(flexFitR)
dt <- data.frame(X = 1:6, Y = c(12, 16, 44, 50, 95, 100))
mo_1 <- modeler(dt, X, Y, fn = "fn_lin", param = c(m = 10, b = -5))
mo_2 <- modeler(dt, X, Y, fn = "fn_quad", param = c(a = 1, b = 10, c = 5))
AIC(mo_1)
#> uid logLik df nobs p AIC
#> 1 1 -21.45745 3 6 2 48.9149
AIC(mo_2)
#> uid logLik df nobs p AIC
#> 1 1 -21.00014 4 6 3 50.00028
BIC(mo_1)
#> uid logLik df nobs p BIC
#> 1 1 -21.45745 3 6 2 48.29017
BIC(mo_2)
#> uid logLik df nobs p BIC
#> 1 1 -21.00014 4 6 3 49.16732