Skip to content

Normal Linear Model, llf #323

Open
Open

Description

@josef-pkt

I always had problems matching llf of the linear models.

I ran into this again, and finally figured out that the scale estimate is MLE based with denominator nobs, instead of the denominator in results.scale which is (nobs - k_vars)

>>> stats.norm.logpdf(res.resid, scale=np.sqrt((res.resid**2).mean())).sum()
-59.216496084705149
>>> res.llf
-59.216496084705149

Even though the scale estimate is different, I think llf is exactly the same as Stata reports (IIRC)

At several places I needed a normal linear model that does not concentrate out the scale/sigma_squared estimate. We should get a basic generic Normal Model class for this.

Activity

  1. josef-pkt commented on Nov 3, 2013

    @josef-pkt
    MemberAuthor

    just to clarify what I think I was thinking when I opened this:

    The scale estimate in the linear models uses the unbiased least squares, while the concentrated loglike uses the definition of the MLE. So llf is not the loglike at [params, scale] but at [params, scale_MLE]

    related discussion in #1170

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions