linearmodels.iv.covariance.HeteroskedasticCovariance

class linearmodels.iv.covariance.HeteroskedasticCovariance(x: ndarray[Any, dtype[float64]], y: ndarray[Any, dtype[float64]], z: ndarray[Any, dtype[float64]], params: ndarray[Any, dtype[float64]], debiased: bool = False, kappa: int | float = 1)[source]

Covariance estimation for heteroskedastic data

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

Model regressors (nobs by nvar)

y: ndarray[Any, dtype[float64]]

Series ,modeled (nobs by 1)

z: ndarray[Any, dtype[float64]]

Instruments used for endogenous regressors (nobs by ninstr)

params: ndarray[Any, dtype[float64]]

Estimated model parameters (nvar by 1)

debiased: bool = False

Flag indicating whether to use a small-sample adjustment

kappa: int | float = 1

Value of kappa in k-class estimator

Notes

Covariance is estimated using

\[n^{-1} V^{-1} \hat{S} V^{-1}\]

where

\[\hat{S} = n^{-1} \sum_{i=1}^n \hat{\epsilon}_i^2 \hat{x}_i^{\prime} \hat{x}_i\]

where \(\hat{\gamma}=(Z'Z)^{-1}(Z'X)\) and \(\hat{x}_i = z_i\hat{\gamma}\). If debiased is true, then \(S\) is scaled by n / (n-k).

\[V = n^{-1} X'Z(Z'Z)^{-1}Z'X\]

where \(X\) is the matrix of variables included in the model and \(Z\) is the matrix of instruments, including exogenous regressors.

Methods

Properties

config

cov

Covariance of estimated parameters

debiased

Flag indicating if covariance is debiased

s

Heteroskedasticity-robust score covariance estimate

s2

Estimated variance of residuals.