abaquant.portfolio.hierarchical

Import path: abaquant.portfolio.hierarchical

Domain: Portfolio construction, optimization, backtesting, risk metrics, and stress testing.

Purpose

Hierarchical Risk Parity allocation.

When to use it

Use this package to transform return histories and covariance estimates into weights, then evaluate those weights out of sample and under explicit scenarios.

Public objects

  • function: hierarchical_risk_parity — Compute Hierarchical Risk Parity weights from covariance and correlation inputs.

Detailed reference

Hierarchical Risk Parity allocation.

Purpose

The module implements quasi-diagonalisation, cluster-risk estimation, and recursive bisection for Hierarchical Risk Parity portfolios.

Conventions

Covariance and correlation matrices must use a common asset ordering. Output weights are indexed by the supplied ticker labels.

References

[ 1 ] Lopez de Prado, M. (2016), “Building Diversified Portfolios that Outperform Out of Sample”.

abaquant.portfolio.hierarchical.hierarchical_risk_parity(cov_matrix, corr_matrix, tickers)

Compute Hierarchical Risk Parity weights from covariance and correlation inputs.

Parameters:
  • cov_matrix (pd.DataFrame) – Square covariance matrix ordered consistently with the asset order.

  • corr_matrix (pd.DataFrame) – Square correlation matrix ordered consistently with covariance and ticker order.

  • tickers (list[str]) – Ticker labels or an iterable of raw ticker strings.

Returns:

Result of the hierarchical risk parity calculation.

Return type:

np.ndarray

Notes

This is an analytical in-sample calculation. It does not by itself model transaction costs, execution effects, taxes, or future return uncertainty.