Canonical Cointegrating Regression

The Canonical Cointegrating Regression (CCR) of Park (1992) transforms both series before the regression instead of correcting the estimates afterwards: the transformed series have errors that are no longer correlated with the regressor’s shocks, so OLS on them is efficient and its t-statistics standard normal.

The formula for the Canonical Cointegrating Regression starts from the static OLS regression of the dependent on the independent price and pairs its residual hat(u_t) with the change of the regressor Delta \(B_{t}\) into \(w_{t}\), for \(t = 2\), …, T:

\[A_{t} = \alpha + \beta \cdot B_{t} + u_{t}\]

It estimates the covariance hat(Sigma) of \(w_{t}\), the weighted sum hat(Lambda) of its autocovariances up to the truncation lag l, and from them the long-run covariance hat(Omega) and the one-sided long-run covariance hat(Delta):

\[\hat{\Sigma} = \frac{\sum_{t=2}^{T} w_{t} \cdot w'_{t}}{n}\] \[\hat{\Lambda} = \sum_{s=1}^{l} \frac{\left(1 - \frac{s}{l + 1}\right) \cdot \sum_{t=s + 2}^{T} w_{t-s} \cdot w'_{t}}{n}\] \[\hat{\Omega} = \hat{\Sigma} + \hat{\Lambda} + \hat{\Lambda}'\] \[\hat{\Delta} = \hat{\Sigma} + \hat{\Lambda}\]

Both series are transformed with these moments, the regressor with G and the dependent price with H:

\[G = \hat{\Sigma}^{-1} \cdot \hat{\Gamma}_{2}\] \[B_{\text{star},t} = B_{t} - G' \cdot w_{t}\] \[H = G \cdot \hat{\beta}_{\text{OLS}} + \frac{e_{2} \cdot \hat{\omega}_{1,2}}{\hat{\omega}_{2,2}}\] \[A_{\text{star},t} = A_{t} - H' \cdot w_{t}\]

The OLS regression of the transformed dependent price on the transformed regressor gives the estimates and their covariance:

\[\hat{\theta} = (Z'_{\text{star}} \cdot Z_{\text{star}})^{-1} \cdot Z'_{\text{star}} \cdot A_{\text{star}}\] \[\omega_{c} = \hat{\omega}_{1,1} - \hat{\omega}_{1,2} \cdot \hat{\omega}_{2,2}^{-1} \cdot \hat{\omega}_{2,1}\] \[\operatorname{cov}\left(\hat{\theta}\right) = \omega_{c} \cdot (Z'_{\text{star}} \cdot Z_{\text{star}})^{-1}\]

Where \(A_{t}\) and \(B_{t}\) are the prices of the dependent and the independent ticker, alpha the constant and beta the long-run slope (the hedge ratio), hat(beta_OLS) its static OLS estimate, T the number of observations and \(n = T - 1\), l the truncation lag, hat(omega_{i,j}) and hat(Delta_{i,j}) the elements of hat(Omega) and hat(Delta), hat(Gamma_2) the second column of hat(Delta)’, \(e_{2}\) the vector (0, 1)’, \(Z_{\text{star} , t}\) the regressors 1 and \(B_{\text{star} , t}\) and hat(theta) the estimates of the constant and the slope. The slope’s t-statistic is standard normal, with a two-sided p-value: a p-value below the significance level (0.05 for the 5% level) means the hedge ratio differs from 0. It shares the asymptotic properties of the Fully Modified OLS and, like it, depends on the truncation lag l.

When two prices are cointegrated, the OLS slope of one on the other is consistent, it converges to the true long-run relation even faster than in an ordinary regression, but its standard errors and t-statistics are not valid: the regression errors are autocorrelated and correlated with the shocks of the regressor, which biases the slope in finite samples and makes its distribution non-standard. A cointegrating regression estimator corrects this, so that the slope, the hedge ratio of a pairs trade, comes with a standard error that can be used to judge it. The estimators assume that the pair is cointegrated; a cointegration test comes first.

Also known as: CCR, Park’s canonical cointegrating regression.

In the Finance Toolkit this is get_cointegrating_regression with method="canonical_cointegrating_regression", the same function as Cointegrating Regression.

Example · KO, PEP · 2021 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_cointegrating_regression:

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["KO", "PEP"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

regression = toolkit.econometrics.get_cointegrating_regression(method="canonical_cointegrating_regression")

regression[["Intercept", "Slope", "Slope Standard Error", "Slope P-Value"]]

Which returns:

Using Your Own Data

get_cointegrating_regression runs on any data, not only prices: ratios, economic indicators, yield curves or your own dataset. Pass a DataFrame, a Series or a dictionary of them to Econometrics as data, with the dates in the rows or the columns, and set changes to how its changes are calculated: "percentage", "log", "difference" for rates and ratios, or None when the data are changes already. For example, for the monthly unemployment rates of the United States and Germany:

from financetoolkit import Economics, Econometrics

economics = Economics(start_date="2000-01-01")

unemployment = economics.get_unemployment_rate(
    countries=["United States", "Germany"], period="monthly"
)

econometrics = Econometrics(data=unemployment, changes="difference")

econometrics.get_cointegrating_regression()

References

  • Paper Park, J.Y. (1992). “Canonical Cointegrating Regressions.” Econometrica, 60(1), 119-143.
  • Library Referenced against arch’s CanonicalCointegratingReg (Canonical Cointegrating Regression)
Share