Skip to main content

bic_python

Function bic_python 

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

Computes BIC using Python/statsmodels convention.

BIC = k*ln(n) - 2logL

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

§Arguments

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

§Example

let bic_value = bic_python(-150.5, 3, 100);  // 3 coefficients, 100 obs