Learn R Programming

flexCountReg (version 0.1.1)

myAIC: Calculate Akaike Information Criterion (AIC)

Description

This function calculates the Akaike Information Criterion (AIC) for a given model.

Usage

myAIC(LL, nparam)

Value

Numeric value representing the AIC.

Arguments

LL

Numeric value representing the log-likelihood of the model.

nparam

Numeric value representing the number of parameters in the model.

Details

The AIC is calculated using the formula: $$AIC = -2 \cdot LL + 2 \cdot nparam$$ Where \(LL\) is the log-likelihood of the model and \(nparam\) is the number of parameters.

Examples

Run this code
LL <- -120.5
nparam <- 5
myAIC(LL, nparam)

Run the code above in your browser using DataLab