Skip to content
All library documents

Optimizing a Cointegration Hedge Ratio by Minimizing the ADF Statistic

Code Stratmill research code

Summary

The method searches for hedge ratios that make a portfolio spread more stationary according to the Augmented Dickey–Fuller (ADF) test statistic. It defines the spread as the target asset’s price series minus a weighted sum of the other price series, then evaluates that spread with an Engle–Granger test. A numerical optimizer using the BFGS method adjusts the weights to minimize the reported ADF statistic.

The routine starts from ratios based on the first target price relative to the other assets’ prices, returns the optimized weights, spread residuals, and optimizer result, and warns if optimization does not converge. The implementation supplies no empirical example or evidence that the resulting portfolio will be profitable or remain cointegrated out of sample. Its docstring also describes the objective as a half-life even though the returned quantity is an ADF test statistic, so the stated objective should be interpreted from the calculation itself. In practice, statistical validation and stability checks remain necessary.

Key ideas

  • The candidate spread subtracts a weighted combination of other assets from a target asset.
  • The objective is to minimize the spread’s ADF test statistic after an Engle–Granger test.
  • BFGS optimization adjusts hedge ratios from an initial price-based guess.
  • The routine warns when optimization fails to converge.
  • The code provides no evidence of profitability or out-of-sample stability.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.