statsmodels.regression.linear_model.GLS.hessian_factor#
- GLS.hessian_factor(params, scale=None, observed=True)[source]#
Compute weights for calculating Hessian.
- Parameters:
- params
ndarray The parameter at which Hessian is evaluated.
- scale
Noneorfloat If scale is None, then the default scale will be calculated. Default scale is defined by self.scaletype and set in fit. If scale is not None, then it is used as a fixed scale.
- observedbool
If True, then the observed Hessian is returned. If false then the expected information matrix is returned.
- params
- Returns:
ndarrayA 1d weight vector used in the calculation of the Hessian. The hessian is obtained by (exog.T * hessian_factor).dot(exog).
- Raises:
NotImplementedErrorIf sigma is a full (non-diagonal) covariance matrix. A 1d per-observation weight vector cannot represent the off-diagonal correlation terms, so no choice of hessian_factor can satisfy the reassembly formula above in this case; fit, predict, and other core results are unaffected; only this diagnostic is unavailable.