statsmodels.regression.mixed_linear_model.MixedLM.loglike#

MixedLM.loglike(params, profile_fe=True)[source]#

Evaluate the (profile) log-likelihood of the linear mixed effects model.

Parameters:
paramsMixedLMParams, or array_like

The parameter value. If array-like, must be a packed parameter vector containing only the covariance parameters.

profile_febool, optional

If True, replace the provided value of fe_params with the GLS estimates.

Returns:
float

The log-likelihood value at params.

Notes

The scale parameter scale is always profiled out of the log-likelihood. In addition, if profile_fe is true the fixed effects parameters are also profiled out.

A singular random effects covariance matrix, or a variance component that is zero, is on the boundary of the parameter space. The log-likelihood is continuous there. Directions with a variance below 1e-10 are dropped from the covariance of the observations, which is the limit as these variances go to zero.