linearmodels.asset_pricing.covariance.KernelCovariance

class linearmodels.asset_pricing.covariance.KernelCovariance(xe: ndarray, *, jacobian: ndarray | None = None, inv_jacobian: ndarray | None = None, kernel: str | None = None, bandwidth: float | None = None, center: bool = True, debiased: bool = False, df: int = 0)[source]

Heteroskedasticity-autocorrelation (HAC) robust covariance estimator

Parameters:
xe: ndarray

The scores (moment) conditions.

jacobian: ndarray | None = None

Jacobian. One and only one of jacobian and inv_jacobian must be provided.

inv_jacobian: ndarray | None = None

Inverse jacobian. One and only one of jacobian and inv_jacobian must be provided.

kernel: str | None = None

Kernel name. See notes for available kernels. The default is “bartlett”.

bandwidth: float | None = None

Non-negative integer bandwidth. If None, the optimal bandwidth is estimated.

center: bool = True

Flag indicating to center the scores when computing the covariance.

debiased: bool = False

Flag indicating to use a debiased estimator.

df: int = 0

Degree of freedom value ot use if debiasing.

Methods

Properties

bandwidth

Bandwidth used in estimation

config

cov

Compute parameter covariance

inv_jacobian

Inverse Jacobian

jacobian

The Jacobian

kernel

Kernel used in estimation

s

Score/moment condition covariance

square

Flag indicating if jacobian is square