linearmodels.iv.gmm.IVGMMCovariance

class linearmodels.iv.gmm.IVGMMCovariance(x: ndarray, y: ndarray, z: ndarray, params: ndarray, w: ndarray, cov_type: str = 'robust', debiased: bool = False, **cov_config: str | bool)[source]

Covariance estimation for GMM models

Parameters:
x: ndarray

Model regressors (nobs by nvar)

y: ndarray

Series ,modeled (nobs by 1)

z: ndarray

Instruments used for endogenous regressors (nobs by ninstr)

params: ndarray

Estimated model parameters (nvar by 1)

w: ndarray

Weighting matrix used in GMM estimation

cov_type: str = 'robust'

Covariance estimator to use Valid choices are

  • ”unadjusted”, “homoskedastic” - Assumes moment conditions are homoskedastic

  • ”robust”, “heteroskedastic” - Allows for heteroskedasticity by not autocorrelation

  • ”kernel” - Allows for heteroskedasticity and autocorrelation

  • ”cluster” - Allows for one-way cluster dependence

debiased: bool = False

Flag indicating whether to debias the covariance estimator

**cov_config: str | bool

Optional keyword arguments that are specific to a particular cov_type

Notes

Optional keyword argument for specific covariance estimators:

kernel

  • kernel: Name of kernel to use. See KernelCovariance for details on available kernels

  • bandwidth: Bandwidth to use when computing the weight. If not provided, nobs - 2 is used.

cluster

Methods

Properties

config

cov

Covariance of estimated parameters

debiased

Flag indicating if covariance is debiased

s

Score covariance estimate

s2

Estimated variance of residuals.