linearmodels.system.gmm.HeteroskedasticWeightMatrix.weight_matrix

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

Construct a GMM weight matrix for a model.

Parameters:
x: Sequence[ndarray[tuple[int, ...], dtype[float64]]]

The regressors (exog and endog) of each equation in the system, with shape (nobs, k_i) for equation i.

z: Sequence[ndarray[tuple[int, ...], dtype[float64]]]

The instruments (exog and instruments) of each equation in the system, with shape (nobs, nz_i) for equation i.

eps: ndarray[tuple[int, ...], dtype[float64]]

Model errors, with shape (nobs, neqn).

sigma: ndarray | None = None

Not used by this estimator. It is accepted so that all the weight matrix estimators have the same signature.

Returns:

Weight matrix, which is the covariance of the GMM moment conditions with shape (nmoments, nmoments).

Return type:

numpy.ndarray