linearmodels.shared.covariance.cov_kernel

linearmodels.shared.covariance.cov_kernel(z: ndarray[tuple[int, ...], dtype[float64]], w: ndarray[tuple[int, ...], dtype[float64]]) → ndarray[tuple[int, ...], dtype[float64]][source]

Core kernel covariance estimator.

Parameters:
z: ndarray[tuple[int, ...], dtype[float64]]

Mean zero data with shape (n, k).

w: ndarray[tuple[int, ...], dtype[float64]]

Kernel weights with shape (m,) for lags 0, 1, …, m - 1. The weight of lag 0 is not used, since the variance is always included with a weight of 1.

Returns:

Kernel asymptotic covariance with shape (k, k).

Return type:

numpy.ndarray

Raises:

ValueError – If the number of weights is larger than the number of observations.