statsmodels/statsmodels — pull request #2124 by kshedden (2014-12-07 01:18:04+00:00)
Title: ENH Handle mean structure parameters in MixedLM by profiling

This PR will bring us closer to what other packages claim to do in terms of optimizing the mixed LM likelihood. The idea is to view the likelihood, score, etc. as functions only of the variance and covariance parameters. This can be achieved by maximizing the full likelihood over the mean structure parameters for any given values of the variance and covariance parameters. This is accomplished in one non-iterative step using GLS.

We still need the likelihood, score, etc. for the full parameter set when doing some post-estimation work, so I added a switch to control whether the mean structure parameters are to be profiled out. There is a keyword argument to bypass the profiling and optimize over the full parameter set, but by default we profile.

The performance improves by about 40% when mean structure parameters dominate, but only slightly otherwise.