Learn R Programming

flexFitR (version 1.2.2)

goodness_of_fit: Akaike's An Information Criterion for an object of class modeler

Description

Generic function calculating Akaike's ‘An Information Criterion’ for fitted model object of class modeler.

Usage

# S3 method for modeler
AIC(object, ..., k = 2)

# S3 method for modeler BIC(object, ...)

Value

A tibble with columns giving the corresponding AIC and BIC.

Arguments

object

An object inheriting from class modeler resulting of executing the function modeler()

...

Further parameters. For future improvements.

k

Numeric, the penalty per parameter to be used; the default k = 2 is the classical AIC.

Author

Johan Aparicio [aut]

Examples

Run this code
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)
AIC(mo_2)
BIC(mo_1)
BIC(mo_2)

Run the code above in your browser using DataLab