Kernel weights from a quadratic-spectral kernel

Parameters:
bw: {int, float}

Maximum lag to used in kernel

nint

Positive number of weight to return

Returns:
ndarray

Weight array ordered by lag position (maxlag + 1)

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.

Return type:

ndarray