linearmodels.iv.covariance.kernel_weight_quadratic_spectral

linearmodels.iv.covariance.kernel_weight_quadratic_spectral(bw: float, n: int) ndarray[source]

Kernel weights from a quadratic-spectral kernel

Parameters:
bw: float

Maximum lag to used in kernel

n: int

Positive number of weight to return

Returns:

Weight array ordered by lag position (maxlag + 1)

Return type:

numpy.ndarray

Notes

Unlike the Bartlett or Parzen kernels, the QS kernel is not truncated at a specific lag, and so weights are computed for all available lags in the sample.

\[\begin{split}z_i & = 6 \pi (i / m) / 5 \\ w_0 & = 1 \\ w_i & = 3(\sin(z_i)/z_i - cos(z_i))/z_i^ 2, \, i \geq 1\end{split}\]

where m is the bandwidth.