Skip to main content

aic_python

Function aic_python 

Source
pub fn aic_python(log_likelihood: f64, n_coef: usize) -> f64
Expand description

Computes AIC using Python/statsmodels convention.

AIC = 2k - 2logL

where k is the number of coefficients (NOT including variance parameter). This matches Python’s statsmodels OLS.aic behavior.

§Arguments

  • log_likelihood - Log-likelihood of the model
  • n_coef - Number of coefficients (including intercept)

§Example

let aic_value = aic_python(-150.5, 3);  // 3 coefficients