# linearmodels.iv.gmm.KernelWeightMatrix¶

class KernelWeightMatrix(kernel='bartlett', bandwidth=None, center=False, debiased=False, optimal_bw=False)[source]

Heteroskedasticity, autocorrelation robust weight estimation

Parameters:
kernelstr

Name of kernel weighting function to use

bandwidth

Bandwidth to use when computing kernel weights

centerbool

Flag indicating whether to center the moment conditions by subtracting the mean before computing the weight matrix.

debiasedbool

Flag indicating whether to use small-sample adjustments

optimal_bwbool

Flag indicating whether to estimate the optimal bandwidth, when bandwidth is None. If False, nobs - 2 is used

Notes

Supported kernels:

• “bartlett”, “newey-west” - Bartlett’s kernel

• “parzen”, “gallant” - Parzen’s kernel

$\begin{split}g_i & =z_i \epsilon_i \\ W & =n^{-1}(\Gamma_0+\sum_{j=1}^{n-1}k(j)(\Gamma_j+\Gamma_j')) \\ \Gamma_j & =\sum_{i=j+1}^n g'_i g_{j-j}\end{split}$

where $$k(j)$$ is the kernel weight for lag j and $$z_i$$ contains both the exogenous regressors and instruments..

Attributes:
bandwidth

Actual bandwidth used in estimating the weight matrix

config

Weight estimator configuration

Methods

 weight_matrix(x, z, eps) Parameters:

Properties

 bandwidth Actual bandwidth used in estimating the weight matrix config Weight estimator configuration