Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a229b0a8fb7c1210

Jump to content

Draft:Canopy (software)

From Wikipedia, the free encyclopedia
  • Comment: This reads like an advert and appears to be AI written, at least in part.
    If the submitting editor, given their user name, has any connection with this product, particularly if it is a paid connection, this needs to be declared. ChrysGalley (talk) 10:14, 21 February 2026 (UTC)

Canopy
DeveloperAnagatam Technologies
ReleaseFebruary 10, 2025; 17 months ago (2025-02-10)
Stable release
3.0.0 / February 21, 2026; 5 months ago (2026-02-21)
Written inPython
Operating systemCross-platform
TypePortfolio optimization, Mathematical finance
LicenseApache License 2.0
Websitegithub.com/Anagatam/Canopy

Canopy is a free and open-source Python library for hierarchical portfolio optimization. Developed by Anagatam Technologies, it implements three allocation algorithms — Hierarchical Risk Parity (HRP), Hierarchical Equal Risk Contribution (HERC), and Nested Cluster Optimization (NCO) — with institutional-grade covariance estimation, configurable risk measures, walk-forward backtesting, and compliance audit trails.

Overview

[edit]

Canopy provides a unified facade interface for hierarchical portfolio construction, enabling researchers and practitioners to compute optimal portfolio weights in a single function call. Unlike traditional mean-variance approaches that require matrix inversion, hierarchical methods build a hierarchical clustering tree from asset correlations and allocate capital through the tree structure, resulting in more stable and diversified portfolios.[1]

The library targets quantitative analysts, portfolio managers, and academic researchers working on portfolio construction problems.

Algorithms

[edit]

Hierarchical Risk Parity (HRP)

[edit]

The HRP algorithm, introduced by Marcos López de Prado in 2016, applies hierarchical clustering to the correlation matrix of asset returns and then uses recursive bisection to allocate weights based on inverse-variance risk parity.[2] Unlike Markowitz mean-variance optimization, HRP does not require matrix inversion, making it more stable for large asset universes.

Hierarchical Equal Risk Contribution (HERC)

[edit]

HERC, proposed by Thomas Raffinot in 2017, extends HRP with a two-stage allocation: inter-cluster risk parity followed by intra-cluster inverse-variance weighting.[3] It supports four risk measures: variance, CVaR (Conditional Value-at-Risk), CDaR (Conditional Drawdown-at-Risk), and MAD (Mean Absolute Deviation).

Nested Cluster Optimization (NCO)

[edit]

NCO, also by López de Prado (2019), applies Tikhonov regularization within each cluster before combining inter-cluster allocations.[4] This approach reduces estimation error in the covariance matrix, producing portfolios with lower tail risk.

Features

[edit]
  • Covariance Estimation: Four estimators — Sample, Ledoit-Wolf shrinkage, Marchenko-Pastur denoising, and EWMA
  • Detoning: Removes the market-mode eigenvector before clustering for sector-level discrimination
  • Portfolio Modes: Long-only, long-short, and market neutral configurations
  • Walk-Forward Backtesting: Monthly/quarterly rebalancing with configurable lookback windows
  • Audit Trail: JSON-serializable computation logs for MiFID II, SEC Rule 15c3-5, and Basel III/IV regulatory compliance
  • Performance Metrics: Sharpe ratio, Sortino ratio, maximum drawdown, CVaR, and information ratio
  • Visualization: Dark-theme Plotly charts including dendrograms, correlation heatmaps, and risk contribution charts

Architecture

[edit]

Canopy uses a facade pattern through its MasterCanopy class, which orchestrates five internal engines:

  • CovarianceEngine — covariance matrix estimation and eigenvalue analysis
  • ClusterEngine — hierarchical clustering with 7 linkage methods
  • HRP, HERC, NCO — the three optimizer implementations
  • ChartEngine — visualization module
  • DataLoader — data ingestion from Yahoo Finance, CSV, and Parquet files

See also

[edit]
[edit]

References

[edit]
  1. ^ López de Prado, Marcos (2016). "Building Diversified Portfolios that Outperform Out-of-Sample". The Journal of Portfolio Management. 42 (4): 59–69. doi:10.3905/jpm.2016.42.4.059.
  2. ^ López de Prado, M. (2016). Building Diversified Portfolios that Outperform Out-of-Sample. The Journal of Portfolio Management, 42(4), 59–69.
  3. ^ Raffinot, T. (2017). Hierarchical Clustering Based Asset Allocation. The Journal of Portfolio Management, 44(2), 89–99.
  4. ^ López de Prado, M. (2019). A Robust Estimator of the Efficient Frontier. Available at SSRN.


Category:Free software programmed in Python Category:Mathematical finance Category:Portfolio theories Category:Financial software Category:Free and open-source software Category:Software using the Apache license