arch.unitroot.auto_bandwidth¶
-
arch.unitroot.auto_bandwidth(y: Sequence[float | int] | ndarray[tuple[int], dtype[float64]] | Series, kernel: 'ba' | 'bartlett' | 'nw' | 'pa' | 'parzen' | 'gallant' | 'qs' | 'andrews' =
'ba') float[source]¶ Automatic bandwidth selection of Andrews (1991) and Newey & West (1994).
- Parameters:¶
- y: Sequence[float | int] | ndarray[tuple[int], dtype[float64]] | Series¶
Data on which to apply the bandwidth selection.
- kernel: 'ba' | 'bartlett' | 'nw' | 'pa' | 'parzen' | 'gallant' | 'qs' | 'andrews' =
'ba'¶ The kernel function to use for selecting the bandwidth. Not case sensitive.
”ba”, “bartlett”, “nw”: Bartlett kernel
”pa”, “parzen”, “gallant”: Parzen kernel
”qs”, “andrews”: Quadratic Spectral kernel
- Returns:¶
The estimated optimal bandwidth.
- Return type:¶
- Raises:¶
TypeError – If y cannot be converted to numbers or kernel is not a str.
ValueError – If y is not 1-d, has fewer than 2 observations or contains NaN or inf, or kernel is not one of the options.