statsmodels.regression.mixed_linear_model.MixedLM.get_scale#

MixedLM.get_scale(fe_params, cov_re, vcomp)[source]#

Return the estimated error variance based on given estimates of the slopes and random effects covariance matrix

Parameters:
fe_paramsarray_like

The regression slope estimates

cov_re2d array_like

Estimate of the random effects covariance matrix

vcomparray_like

Estimate of the variance components

Returns:
scalefloat

The estimated error variance.

Notes

If the random effects covariance matrix is singular or a variance component is zero, then 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.