Learn R Programming

flexCountReg (version 0.1.1)

myBIC: Calculate Bayesian Information Criterion (BIC)

Description

This function calculates the Bayesian Information Criterion (BIC) for a given model.

Usage

myBIC(LL, nparam, n)

Value

Numeric value representing the BIC.

Arguments

LL

Numeric value representing the log-likelihood of the model.

nparam

Numeric value representing the number of parameters in the model.

n

Numeric value representing the number of observations.

Details

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

Examples

Run this code
LL <- -120.5
nparam <- 5
n <- 100
myBIC(LL, nparam, n)

Run the code above in your browser using DataLab