arch.covariance.kernel.Parzen

class arch.covariance.kernel.Parzen(x: ndarray | DataFrame | Series, bandwidth: float | None = None, df_adjust: int = 0, center: bool = True, weights: ndarray | DataFrame | Series | None = None, force_int: bool = False)[source]

Parzen’s kernel covariance estimation.

Parameters:
x: ndarray | DataFrame | Series

The data to use in covariance estimation.

bandwidth: float | None = None

The kernel’s bandwidth. If None, optimal bandwidth is estimated.

df_adjust: int = 0

Degrees of freedom to remove when adjusting the covariance. Uses the number of observations in x minus df_adjust when dividing inner-products.

center: bool = True

A flag indicating whether x should be demeaned before estimating the covariance.

weights: ndarray | DataFrame | Series | None = None

An array of weights used to combine when estimating optimal bandwidth. If not provided, a vector of 1s is used. Must have nvar elements.

force_int: bool = False

Force bandwidth to be an integer.

Notes

The kernel weights are computed using

\[\begin{split}w=\begin{cases}1-6z^{2}\left(1-z\right) & z\leq\frac{1}{2} \\ 2\left(1-z\right)^{3} & \frac{1}{2}<z\leq1 \\ 0 & z>1 \end{cases}\end{split}\]

where \(z=\frac{h}{H}, h=0, 1, \ldots, H\) where H is the bandwidth.

Methods

Properties

bandwidth

The bandwidth used by the covariance estimator.

bandwidth_scale

The power used in optimal bandwidth calculation.

centered

Flag indicating whether the data are centered (demeaned).

cov

The estimated covariances.

force_int

Flag indicating whether the bandwidth is restricted to be an integer.

kernel_const

The constant used in optimal bandwidth calculation.

kernel_weights

Weights used in covariance calculation.

name

The covariance estimator's name.

opt_bandwidth

Estimate optimal bandwidth.

rate

The optimal rate used in bandwidth selection.