linearmodels.system.gmm.KernelWeightMatrix¶
-
class linearmodels.system.gmm.KernelWeightMatrix(center: bool =
False
, debiased: bool =False
, kernel: str ='bartlett'
, bandwidth: float | None =None
, optimal_bw: bool =False
)[source]¶ Heteroskedasticity robust weight estimation
- Parameters:¶
- center: bool =
False
¶ Flag indicating whether to center the moment conditions by subtracting the mean before computing the weight matrix.
- debiased: bool =
False
¶ Flag indicating whether to use small-sample adjustments
- kernel: str =
'bartlett'
¶ Name of kernel to use. Supported kernels include:
”bartlett”, “newey-west” : Bartlett’s kernel
”parzen”, “gallant” : Parzen’s kernel
”qs”, “quadratic-spectral”, “andrews” : Quadratic spectral kernel
- bandwidth: float | None =
None
¶ Bandwidth to use for the kernel. If not provided the optimal bandwidth will be estimated.
- optimal_bw: bool =
False
¶ Flag indicating whether to estimate the optimal bandwidth, when bandwidth is None. If False, nobs - 2 is used
- center: bool =
Notes
The weight matrix estimator is
\[\begin{split}W & = \hat{\Gamma}_0+\sum_{i=1}^{n-1} w_i (\hat{\Gamma}_i+\hat{\Gamma}_i^\prime) \hat{\Gamma}_j & = n^{-1}\sum_{i=1}^{n-j} g'_ig_{i+j} \\ g_i & = (z_{1i}\epsilon_{1i},z_{2i}\epsilon_{2i},\ldots,z_{ki}\epsilon_{ki})\end{split}\]where \(g_i\) is the vector of scores across all equations for observation i and \(w_j\) are the kernel weights which depend on the selected kernel and bandwidth. \(z_{ji}\) is the vector of instruments for equation j and \(\epsilon_{ji}\) is the error for equation j for observation i. This form allows for heteroskedasticity and autocorrelation between the moment conditions.
Methods
sigma
(eps, x)Estimate residual covariance.
weight_matrix
(x, z, eps, *[, sigma])Construct a GMM weight matrix for a model.
Properties
Bandwidth used to estimate covariance of moment conditions
Weight estimator configuration
Kernel used in estimation