Skip to content

BUG/REF: OrderedModel, df_model is k_params, not extra over null model #8482

Closed

Description

@josef-pkt

OrderedModel uses
self.df_model = self.k_vars + self.k_extra

The definition of df_model should be k_params - k_null

see #8481 and #8475

I'm working on changing and fixing df_resid, df_model in GenericLikelihoodModel in #8476
With my latest changes df_model definition raises a Warning

The constants only model should have k_null = number of thresholds (for empty exog which cannot include a constant)
so df_model should be k_vars, exog.shape[1]

aside: the null model Results.llnull uses parameter estimates from OrderedModel.start_params

Activity

  1. added this to the 0.14 milestone on Oct 29, 2022
  2. josef-pkt commented on Nov 29, 2022

    @josef-pkt
    MemberAuthor

    fixed in #8476

    changed to

            self.k_extra = self.k_levels - 1
            self.df_model = self.k_vars
            self.df_resid = self.nobs - (self.k_vars + self.k_extra)
    

    I don't see unit tests for it in the merged PR.
    ???

  3. bashtage commented on Jul 30, 2026

    @bashtage
    Member

    Fixed by PR #8476: df_model is now correctly computed as params-over-null (self.k_vars) rather than total params. Closing as fixed.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions