Skip to content

GLS uncentered_tss and rsquared #1171

Closed

Description

@josef-pkt

see also #1170 for definitions in WLS

"this is probably broken for GLS"

    def centered_tss(self):
        model = self.model
        weights = getattr(model, 'weights', None)
        if weights is not None:
            return np.sum(weights*(model.endog - np.average(model.endog,
                                                        weights=weights))**2)
        else: # this is probably broken for GLS
            centered_endog = model.wendog - model.wendog.mean()
            return np.dot(centered_endog, centered_endog)

I guess:
model.wendog.mean() should be replaced by the y_fitted for a regression on constant only

something like, based on GLS of y on constant:

wconst = model.whiten(np.ones(nobs))  # should be wexog[:, const_idx] if available
wfitted_const = wconst * np.dot(wconst, wconst) * np.dot(wconst, wendog)
 centered_endog = model.wendog - wfitted_const

Activity

  1. added this to the 0.10 milestone on May 27, 2017
  2. added 2 commits that reference this issue on Aug 23, 2018
    b29ddaa
    d4b0801
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions