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

goodness_of_fitR Documentation

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 class 'modeler'
AIC(object, ..., k = 2)

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

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.

Value

A tibble with columns giving the corresponding AIC and BIC.

Author(s)

Johan Aparicio [aut]

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

flexFitR documentation built on April 16, 2025, 5:09 p.m.