MixedLM.fit_regularized(start_params=None, method='l1', alpha=0, ceps=0.0001, ptol=1e-06, maxit=200, **fit_kwargs)[source]

Fit a model in which the fixed effects parameters are penalized. The dependence parameters are held fixed at their estimated values in the unpenalized model.

methodstring of Penalty object

Method for regularization. If a string, must be ‘l1’.


Scalar or vector of penalty weights. If a scalar, the same weight is applied to all coefficients; if a vector, it contains a weight for each coefficient. If method is a Penalty object, the weights are scaled by alpha. For L1 regularization, the weights are used directly.

cepspositive real scalar

Fixed effects parameters smaller than this value in magnitude are treaded as being zero.

ptolpositive real scalar

Convergence occurs when the sup norm difference between successive values of fe_params is less than ptol.


The maximum number of iterations.


Additional keyword arguments passed to fit.

A MixedLMResults instance containing the results.


The covariance structure is not updated as the fixed effects parameters are varied.

The algorithm used here for L1 regularization is a”shooting” or cyclic coordinate descent algorithm.

If method is ‘l1’, then fe_pen and cov_pen are used to obtain the covariance structure, but are ignored during the L1-penalized fitting.


Friedman, J. H., Hastie, T. and Tibshirani, R. Regularized Paths for Generalized Linear Models via Coordinate Descent. Journal of Statistical Software, 33(1) (2008)