The math, shown.
Every optimizer in Argmin is implemented from scratch in NumPy, SciPy, and CVXPY - no portfolio library does the work for us. This page states each model as a convex program, derives the closed forms where they exist, and renders the intermediate objects (shrunk covariance, linkage tree, bootstrap distribution) from the same engine output that drives the backtest. Numbers here reconcile with the tearsheet on a single fixed window.
Notation
used throughoutContents
Mean-variance & the efficient frontier
Markowitz[1] casts allocation as a trade-off between return and variance. Tracing the minimum-variance weight for each attainable return level sweeps out the efficient frontier. The long-only, fully-invested program above is a convex quadratic program; Argmin solves it with CVXPY (Clarabel/OSQP).
The tangency (max-Sharpe) portfolio is the frontier point that maximizes the reward-to-risk ratio relative to the risk-free asset:
Ledoit-Wolf shrinkage
The sample covariance is unbiased but ill-conditioned when the number of assets is comparable to the sample length: its extreme eigenvalues are systematically distorted, which mean-variance amplifies into unstable weights. Ledoit and Wolf[2] shrink toward a structured target (here a constant-correlation matrix) by an intensity chosen to minimize expected Frobenius loss in closed form.
On this window the optimal intensity is δ = 0.0064. A small means the sample matrix is already well-conditioned over 2007-2024; the estimator still removes the noisiest off-diagonal extremes, as the side-by-side below shows.
Correlation of the 11-asset universe. The sample estimate is noisy in its off-diagonal entries; Ledoit-Wolf pulls every entry toward the structured target by intensity δ = 0.0064, shrinking extreme correlations toward the average. A low δ here signals the sample matrix is already well conditioned over this window.
Risk parity (ERC)
Risk parity targets equal risk contributions rather than equal capital. The marginal risk of asset is , so its risk contribution is . The equal-risk-contribution portfolio satisfies
Argmin solves this through Spinu's[3] convex log-barrier formulation above: the unique interior minimizer has equal risk contributions after normalization, and the log term acts as a smooth barrier keeping every weight strictly positive.
Hierarchical risk parity
HRP[6] avoids inverting entirely - the step that makes mean-variance fragile. It proceeds in three stages: (1) convert correlations to the distance metric above and build a hierarchical clustering tree; (2) quasi-diagonalize by reordering assets so the most-correlated sit adjacent; (3) allocate top-down by recursive bisection, splitting each cluster's budget in inverse proportion to its variance.
The dendrogram below is the actual linkage tree estimated on this universe; leaf order is the quasi-diagonal sequence the bisection then walks.
Leaves are ordered by recursive agglomeration so that adjacent assets are the most correlated, the quasi-diagonal sequence GLD → LQD → AGG → TLT → DBC → HYG → VNQ → EEM → EFA → SPY → QQQ. Each leaf is annotated with its annualized volatility; bracket height is the cluster linkage distance.
Maximum diversification
The diversification ratio[5] is the weighted average of asset volatilities divided by the portfolio volatility. It equals one only when assets are perfectly correlated and grows as the portfolio harvests diversification, so maximizing it,
produces the “most diversified portfolio.” The objective is scale-invariant; Argmin solves the equivalent convex problem of minimizing subject to and then renormalizing.
Black-Litterman
Black-Litterman[4] starts from market-implied equilibrium returns obtained by reverse optimization,
where is the market risk-aversion and the market-cap weights. Investor views are encoded as with uncertainty , and the posterior above is the precision-weighted blend of the prior and the views . With no views it collapses to , recovering the equilibrium portfolio - which is the regularized prior that tames mean-variance's sensitivity to noisy .
Note: Argmin uses an equal-weight market proxy (no live market-cap feed), so reflects a 1/N reference rather than true float weights. This is stated again in the limitations.
Probabilistic & deflated Sharpe
A Sharpe ratio is itself an estimate with sampling error, and that error is larger for skewed, fat-tailed returns. The probabilistic Sharpe ratio[7] gives the probability that the true Sharpe exceeds a benchmark , adjusting for skewness and kurtosis of the returns.
When many strategies are tried, the best in-sample Sharpe is upward-biased. The deflated Sharpe ratio corrects for this multiple-testing by raising the benchmark to the expected maximum of trials:
Here is the Euler-Mascheroni constant and the number of trials. Argmin deflates over 7 candidate strategies. We also report a block-bootstrap confidence interval (block size 21 days, 1,000 resamples) to preserve autocorrelation in the resampled returns.
Block-bootstrap sampling distribution of the out-of-sample Sharpe ratio (1,000 resamples, normal approximation). The shaded region is the 95% confidence interval [0.41, 1.34]; the marker is the realized estimate 0.85. The interval excludes zero, so the result is unlikely to be luck alone over this window.
Reconciliation with the tearsheet
The same max-Sharpe strategy headline numbers shown on /explore are reproduced below verbatim from the backtest tearsheet. They are out-of-sample, net of transaction costs, on the 2007-01-01 → 2024-12-31 window.
Max Sharpe - out-of-sample
engine 012c0e3f119d · generated 2026-06-23Honesty & limitations
Not investment advice
This is a research and engineering portfolio piece. Nothing here is a recommendation to buy or sell any security. Past performance does not predict future results.
Estimation error dominates
Expected returns are notoriously hard to estimate; small errors in μ swing mean-variance weights sharply. Shrinkage, risk parity, and HRP exist precisely to blunt this, and we still report deflated, not raw, significance.
Equal-weight market proxy
Black-Litterman equilibrium returns π use a 1/N market proxy rather than live market-cap weights, since the engine ships no live cap feed. Treat the BL prior as illustrative.
Constant risk-free rate
A flat 2% risk-free rate is assumed over the whole window rather than a rolling short-rate series. This slightly biases Sharpe levels but not the relative ranking of strategies.
Out-of-sample, with costs
All reported metrics come from a walk-forward backtest: parameters are fit on a rolling lookback and evaluated only on subsequent, unseen returns, net of transaction costs. In-sample numbers are never reported as if they were OOS.
Single fixed window
Results are one realization on 2007-01-01 to 2024-12-31. They are not bootstrapped across alternative universes or regimes; the confidence interval quantifies sampling uncertainty within this window only.
Sources
- [1]Markowitz, H. (1952). Portfolio Selection. The Journal of Finance 7(1), 77-91.
- [2]Ledoit, O. & Wolf, M. (2004). A Well-Conditioned Estimator for Large-Dimensional Covariance Matrices. Journal of Multivariate Analysis 88(2), 365-411.
- [3]Spinu, F. (2013). An Algorithm for Computing Risk Parity Weights. SSRN Working Paper 2297383.
- [4]Black, F. & Litterman, R. (1992). Global Portfolio Optimization. Financial Analysts Journal 48(5), 28-43.
- [5]Choueifaty, Y. & Coignard, Y. (2008). Toward Maximum Diversification. The Journal of Portfolio Management 35(1), 40-51.
- [6]López de Prado, M. (2016). Building Diversified Portfolios that Outperform Out of Sample. The Journal of Portfolio Management 42(4), 59-69.
- [7]Bailey, D. H. & López de Prado, M. (2014). The Deflated Sharpe Ratio: Correcting for Selection Bias, Backtest Overfitting, and Non-Normality. The Journal of Portfolio Management 40(5), 94-107.