Skip to content

df_model in mixed_linear_model #3742

Open

Description

@jbrockmendel

Last one for a while, scout's honor.

MixedLMResults has an aic method:

    @cache_readonly
    def aic(self):
        if self.reml:
            return np.nan
        if self.freepat is not None:
            df = self.freepat.get_packed(use_sqrt=False, has_fe=True).sum() + 1
        else:
            df = self.params.size + 1
        return -2 * (self.llf - df)

bic follows the same pattern.

The local df variable here behaves a lot like df_model does elsewhere (or in many cases, like df_model+1). The class does not define a df_model attribute, but does define df_resid as the fairly-standard self.df_resid = self.nobs - np_matrix_rank(self.model.exog).

Would it make sense to define df_model to match that df? Is df_resid invariant to which of those three cases for df holds?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions