linearmodels.system.gmm.HeteroskedasticWeightMatrix.weight_matrix

HeteroskedasticWeightMatrix.weight_matrix(x: Sequence[ndarray[Any, dtype[float64]]], z: Sequence[ndarray[Any, dtype[float64]]], eps: ndarray[Any, dtype[float64]], *, sigma: ndarray | None = None) ndarray[Any, dtype[float64]][source]

Construct a GMM weight matrix for a model.

Parameters:
x: Sequence[ndarray[Any, dtype[float64]]]

Model regressors (exog and endog), (nobs by nvar)

z: Sequence[ndarray[Any, dtype[float64]]]

Model instruments (exog and instruments), (nobs by ninstr)

eps: ndarray[Any, dtype[float64]]

Model errors (nobs by 1)

sigma: ndarray | None = None

Fixed covariance of model errors. If None, estimated from eps.

Returns:

Covariance of GMM moment conditions.

Return type:

numpy.ndarray