|
8 | 8 | from statsmodels.iolib.table import SimpleTable |
9 | 9 | from statsmodels.regression.linear_model import OLS, RegressionResults |
10 | 10 |
|
11 | | -import arch.covariance.kernel as lrcov |
| 11 | +from arch.covariance import KERNEL_ERR, KERNEL_ESTIMATORS |
| 12 | +from arch.covariance.kernel import CovarianceEstimate, CovarianceEstimator |
12 | 13 | from arch.typing import ArrayLike1D, ArrayLike2D, NDArray |
13 | 14 | from arch.unitroot._engle_granger import EngleGrangerTestResults, engle_granger |
14 | 15 | from arch.unitroot._phillips_ouliaris import ( |
|
17 | 18 | phillips_ouliaris, |
18 | 19 | ) |
19 | 20 | from arch.unitroot._shared import ( |
20 | | - KERNEL_ERR, |
21 | | - KERNEL_ESTIMATORS, |
22 | 21 | _check_cointegrating_regression, |
23 | 22 | _check_kernel, |
24 | 23 | _cross_section, |
@@ -46,7 +45,7 @@ def __init__( |
46 | 45 | params: pd.Series, |
47 | 46 | cov: pd.DataFrame, |
48 | 47 | resid: pd.Series, |
49 | | - kernel_est: lrcov.CovarianceEstimator, |
| 48 | + kernel_est: CovarianceEstimator, |
50 | 49 | num_x: int, |
51 | 50 | trend: str, |
52 | 51 | df_adjust: bool, |
@@ -126,7 +125,7 @@ def rsquared_adj(self) -> float: |
126 | 125 | return self._rsquared_adj |
127 | 126 |
|
128 | 127 | @cached_property |
129 | | - def _cov_est(self) -> lrcov.CovarianceEstimate: |
| 128 | + def _cov_est(self) -> CovarianceEstimate: |
130 | 129 | r = np.asarray(self._resid) |
131 | 130 | kern_class = self._kernel_est.__class__ |
132 | 131 | bw = self._bandwidth |
@@ -329,7 +328,7 @@ def __init__( |
329 | 328 | lags: int, |
330 | 329 | leads: int, |
331 | 330 | cov_type: str, |
332 | | - kernel_est: lrcov.CovarianceEstimator, |
| 331 | + kernel_est: CovarianceEstimator, |
333 | 332 | num_x: int, |
334 | 333 | trend: str, |
335 | 334 | reg_results: RegressionResults, |
@@ -776,7 +775,7 @@ def _cov( |
776 | 775 | df_adjust: bool, |
777 | 776 | rhs: pd.DataFrame, |
778 | 777 | resids: pd.Series, |
779 | | - ) -> Tuple[pd.DataFrame, lrcov.CovarianceEstimator]: |
| 778 | + ) -> Tuple[pd.DataFrame, CovarianceEstimator]: |
780 | 779 | """Estimate the covariance""" |
781 | 780 | kernel = kernel.lower().replace("-", "").replace("_", "") |
782 | 781 | if kernel not in KERNEL_ESTIMATORS: |
@@ -810,7 +809,7 @@ def __init__( |
810 | 809 | cov: pd.DataFrame, |
811 | 810 | resid: pd.Series, |
812 | 811 | omega_112: float, |
813 | | - kernel_est: lrcov.CovarianceEstimator, |
| 812 | + kernel_est: CovarianceEstimator, |
814 | 813 | num_x: int, |
815 | 814 | trend: str, |
816 | 815 | df_adjust: bool, |
@@ -981,7 +980,7 @@ def __init__( |
981 | 980 |
|
982 | 981 | def _common_fit( |
983 | 982 | self, kernel: str, bandwidth: Optional[float], force_int: bool, diff: bool |
984 | | - ) -> Tuple[lrcov.CovarianceEstimator, NDArray, NDArray]: |
| 983 | + ) -> Tuple[CovarianceEstimator, NDArray, NDArray]: |
985 | 984 | kernel = _check_kernel(kernel) |
986 | 985 | res = _cross_section(self._y, self._x, self._trend) |
987 | 986 | x = np.asarray(self._x) |
|
0 commit comments