arch.unitroot.cointegration.CanonicalCointegratingReg

class arch.unitroot.cointegration.CanonicalCointegratingReg(y: ndarray[tuple[int], dtype[float64]] | Series, x: ndarray[tuple[int, int], dtype[float64]] | DataFrame, trend: 'n' | 'c' | 'ct' | 'ctt' = 'c', x_trend: 'n' | 'c' | 'ct' | 'ctt' | None = None)[source]

Canonical Cointegrating Regression cointegrating vector estimation.

Parameters:
y: ndarray[tuple[int], dtype[float64]] | Series

The left-hand-side variable in the cointegrating regression. It must be 1-d and contain only finite values.

x: ndarray[tuple[int, int], dtype[float64]] | DataFrame

The right-hand-side variables in the cointegrating regression. It must be 1-d or 2-d with the same number of rows as y, at least 1 column, the same index as y if both are pandas objects, and contain only finite values. The number of rows must be at least two more than the number of parameters in the cointegrating regression (the number of columns of x and the number of terms in trend).

trend: 'n' | 'c' | 'ct' | 'ctt' = 'c'

Trend to include in the cointegrating regression. Not case sensitive. Trends are:

  • ”n”: No deterministic terms

  • ”c”: Constant

  • ”ct”: Constant and linear trend

  • ”ctt”: Constant, linear and quadratic trends

x_trend: 'n' | 'c' | 'ct' | 'ctt' | None = None

Trends that affect the x-data but do not appear in the cointegrating regression. x_trend must be at least as large as trend, so that if trend is “ct”, x_trend must be either “ct” or “ctt”. If None, x_trend is the same as trend. Not case sensitive.

Raises:
  • TypeError – If y or x cannot be converted to float64, or trend or x_trend is not a string.

  • ValueError – If y or x contains NaN or inf, does not have the required dimensions, the same number of rows or the same index, or has too few rows. Also if trend or x_trend is not one of the options.

Notes

The cointegrating vector is estimated from the regressions

\[\begin{split}Y_t & = D_{1t} \delta + X_t \beta + \eta_{1t} \\ X_t & = D_{1t} \Gamma_1 + D_{2t}\Gamma_2 + \epsilon_{2t} \\ \eta_{2t} & = \Delta \epsilon_{2t}\end{split}\]

or if estimated in differences, the last two lines are

\[\Delta X_t = \Delta D_{1t} \Gamma_1 + \Delta D_{2t} \Gamma_2 + \eta_{2t}\]

Define the vector of residuals as \(\eta = (\eta_{1t},\eta'_{2t})'\), and the long-run covariance

\[\Omega = \sum_{h=-\infty}^{\infty} E[\eta_t\eta_{t-h}']\]

and the one-sided long-run covariance matrix

\[\Lambda_0 = \sum_{h=0}^\infty E[\eta_t\eta_{t-h}']\]

The covariance matrices are partitioned into a block form

\[\begin{split}\Omega = \left[\begin{array}{cc} \omega_{11} & \omega_{12} \\ \omega'_{12} & \Omega_{22} \end{array} \right]\end{split}\]

The cointegrating vector is then estimated using modified data

\[\begin{split}X^\star_t & = X_t - \hat{\Lambda}_2'\hat{\Sigma}^{-1}\hat{\eta}_t \\ Y^\star_t & = Y_t - (\hat{\Sigma}^{-1} \hat{\Lambda}_2 \hat{\beta} + \hat{\kappa})' \hat{\eta}_t\end{split}\]

where \(\hat{\kappa} = (0,\hat{\Omega}_{22}^{-1}\hat{\Omega}'_{12})\) and the regression

\[Y^\star_t = D_{1t} \delta + X^\star_t \beta + \eta^\star_{1t}\]

See [1] for further details.

References

Methods

fit([kernel, bandwidth, force_int, diff, ...])

Estimate the cointegrating vector.