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
BUG: Fix definition of GLS r2
BUG: Fix definition of GLS r2