Skip to content

Methodology

Optimisation

The mean–variance problems Ardentum solves, how they are solved exactly, and how every solution is checked and explained.

Objectives

Let ww be portfolio weights, μ\mu annualised expected returns, Σ\Sigma the annualised covariance and rfr_f the risk-free rate on the same scale (Markowitz, 1952).

ObjectiveProblem
Minimum volatilitymin⁡w w⊤Σw\min_w\ w^\top\Sigma w
Maximum Sharpe ratiomax⁡w (μ⊤w−rf)/w⊤Σw\max_w\ (\mu^\top w - r_f)/\sqrt{w^\top\Sigma w}
Target returnmin⁡w w⊤Σw  s.t.  μ⊤w≥m\min_w\ w^\top\Sigma w\ \text{ s.t. }\ \mu^\top w \ge m
Target volatilitymax⁡w μ⊤w  s.t.  w⊤Σw≤σ∗\max_w\ \mu^\top w\ \text{ s.t. }\ \sqrt{w^\top\Sigma w} \le \sigma^*
Maximum utilitymax⁡w μ⊤w−γ2w⊤Σw\max_w\ \mu^\top w - \tfrac{\gamma}{2}w^\top\Sigma w
Minimum CVaRmin⁡w CVaRβ(−Rw)\min_w\ \mathrm{CVaR}_\beta(-R w), optionally s.t. μ⊤w≥m\mu^\top w \ge m (see below)
Risk paritywi(Σw)i=1n w⊤Σww_i(\Sigma w)_i = \tfrac{1}{n}\,w^\top\Sigma w for every held asset (see below)

All except risk parity share the constraint set C\mathcal C below. Variance is written ∥Fw∥22\lVert F w\rVert_2^2 with F=Λ1/2V⊤F = \Lambda^{1/2}V^\top from the eigendecomposition Σ=VΛV⊤\Sigma = V\Lambda V^\top, which is exact and numerically robust even for singular (positive semi-definite) matrices.

Constraints

ConstraintFormulation
Full investment1⊤w=1\mathbf 1^\top w = 1
Position boundsℓi≤wi≤ui\ell_i \le w_i \le u_i (global or per asset)
Exclusions (assets or sectors)wi=0w_i = 0
Sector limitss‾k≤∑i∈Skwi≤s‾k\underline s_k \le \sum_{i\in S_k} w_i \le \overline s_k
Minimum ESG scores⊤w≥smin⁡s^\top w \ge s_{\min} (long-only)
Gross exposure∥w∥1≤L\lVert w\rVert_1 \le L
Tracking error∥F(w−b)∥2≤TEmax⁡\lVert F(w - b)\rVert_2 \le TE_{\max}

All are linear or second-order-cone constraints, so every problem is convex and has a global optimum that interior-point solvers find reliably.

Maximum Sharpe ratio: an exact convex reformulation

The Sharpe ratio is not concave, but with the Charnes–Cooper change of variables y=κwy = \kappa w, κ>0\kappa > 0 (Charnes & Cooper, 1962; Cornuéjols & Tütüncü, 2007) the problem becomes

min⁡y,κ y⊤Σys.t.(μ−rf1)⊤y=1,Ay≤b κ,κ≥0,\min_{y,\kappa}\ y^\top\Sigma y\quad\text{s.t.}\quad (\mu - r_f\mathbf 1)^\top y = 1,\quad A y \le b\,\kappa,\quad \kappa \ge 0,

a convex quadratic programme whose solution gives w⋆=y⋆/κ⋆w^\star = y^\star/\kappa^\star. Every linear constraint is homogenised the same way; the tracking-error cone becomes ∥F(y−bκ)∥≤TEmax⁡κ\lVert F(y - b\kappa)\rVert \le TE_{\max}\kappa.

The reformulation requires a feasible portfolio with expected return above rfr_f. Ardentum first solves max⁡μ⊤w−rf\max \mu^\top w - r_f over C\mathcal C; if that is not positive, the maximum-Sharpe portfolio is undefined and reported as such rather than approximated.

Minimum CVaR: a linear programme over history

Volatility treats gains and losses alike and assumes nothing about tails. Conditional value at risk (CVaR, expected shortfall) at level β\beta is the average loss in the worst 1−β1-\beta of outcomes. Using the TT historical per-period return vectors rtr_t of the estimation window as equally likely scenarios, Rockafellar and Uryasev (2000) show

CVaRβ(w)=min⁡α α+1(1−β)T∑t=1T(−rt⊤w−α)+,\mathrm{CVaR}_\beta(w) = \min_{\alpha}\ \alpha + \frac{1}{(1-\beta)T}\sum_{t=1}^{T}\big(-r_t^\top w - \alpha\big)^+ ,

with the minimising α\alpha equal to the value at risk. Introducing ut≥0u_t \ge 0, ut≥−rt⊤w−αu_t \ge -r_t^\top w - \alpha turns minimum CVaR into a linear programme (plus any second-order-cone constraints such as tracking error), solved jointly over (w,α,u)(w,\alpha,u). The result keeps the empirical distribution's fat tails and asymmetry.

CVaR here is per data period (e.g. one-day CVaR for daily data) and is historical: it cannot anticipate losses worse than the window contains. At least 1/(1−β)1/(1-\beta) observations are required. Every optimisation result also reports the historical one-period VaR and CVaR of its weights at the chosen level.

Validation: the optimum equals an independent solution of the same programme by SciPy's HiGHS solver, is no worse than a brute-force grid over the simplex, and the reported CVaR equals the closed form (mean of the kk worst losses when (1−β)T=k(1-\beta)T=k).

Risk parity: equal risk contributions

The Euler decomposition splits portfolio variance into one contribution per asset, wi(Σw)iw_i(\Sigma w)_i, which sum to w⊤Σww^\top\Sigma w. A risk parity (equal risk contribution) portfolio makes these contributions equal, so each of the nn holdings carries 1/n1/n of the risk (Maillard, Roncalli and Teiletche, 2010). It uses no expected returns, the noisiest input, which is its appeal; the price is that low-risk assets can need large weights.

The weights solve Spinu's (2013) strictly convex problem

min⁡y>0 12 y⊤Σy−1n∑i=1nlog⁡yi,w=y / ∑iyi.\min_{y>0}\ \tfrac12\,y^\top\Sigma y - \tfrac1n\sum_{i=1}^n \log y_i, \qquad w = y\,/\,\textstyle\sum_i y_i .

Its optimality condition (Σy)i=1/(n yi)(\Sigma y)_i = 1/(n\,y_i) says exactly that every yi(Σy)iy_i(\Sigma y)_i equals 1/n1/n, and strict convexity makes the solution unique when Σ\Sigma is positive definite. CVXPY solves it (an exponential-cone programme), and a few Newton steps on the optimality condition make the shares equal to machine precision. Excluded assets are left out; short positions are not allowed.

The weights are set by the risks alone, so other constraints (weight and sector limits, a minimum ESG score, a tracking-error limit) are checked afterwards. A broken one is reported with the weight that breaks it, for example "GOVB.SYN gets 45.1%, above its maximum of 30.0%", rather than replaced by a portfolio that is no longer risk parity.

Validation: two assets give inverse-volatility weights for any correlation, and so does any number of assets with one common correlation (closed forms); every risk contribution equals 1/n1/n to 10−1010^{-10}; the weights match an independent solution of the same problem by SciPy's quasi-Newton method; and the volatility lies between those of the minimum-variance and equally weighted portfolios, as Maillard, Roncalli and Teiletche prove.

Efficient frontier

The frontier is traced by solving the target-return problem on a grid from the minimum-volatility portfolio's return up to the maximum return attainable under C\mathcal C (a linear programme). The problem is compiled once with the target as a parameter and re-solved for each point. Without constraints other than full investment, the frontier is Merton's (1972) hyperbola

σ2(m)=Am2−2Bm+CAC−B2,A=1⊤Σ−11, B=1⊤Σ−1μ, C=μ⊤Σ−1μ,\sigma^2(m) = \frac{A m^2 - 2Bm + C}{AC - B^2},\quad A=\mathbf 1^\top\Sigma^{-1}\mathbf 1,\ B=\mathbf 1^\top\Sigma^{-1}\mu,\ C=\mu^\top\Sigma^{-1}\mu,

which Ardentum reproduces to within 10−510^{-5} relative error (automated test). The capital market line runs from rfr_f through the maximum-Sharpe portfolio.

Mean-CVaR efficient frontier

Replacing variance by historical CVaR gives the mean-CVaR frontier (Rockafellar and Uryasev 2002; Krokhmal, Palmquist and Uryasev 2002). For each target mm on a grid from the minimum-CVaR portfolio's expected return to the highest attainable return,

min⁡w,α,u α+1(1−β)T∑t=1Tuts.t.ut≥−rt⊤w−α, ut≥0, μ⊤w≥m, w∈C.\min_{w,\alpha,u}\ \alpha + \frac{1}{(1-\beta)T}\sum_{t=1}^{T} u_t \quad\text{s.t.}\quad u_t \ge -r_t^\top w - \alpha,\ u_t \ge 0,\ \mu^\top w \ge m,\ w \in \mathcal C .

The optimal value is a convex, nondecreasing function of mm, so only the efficient branch above the minimum-CVaR portfolio is shown. As with minimum CVaR, the tail measure is per data period and historical; expected returns are the same annualised estimates used elsewhere. The page also measures the mean-variance frontier's portfolios by the same CVaR: for elliptical (e.g. normal) returns the two frontiers coincide, so a gap between them is a picture of the fat tails and skew that volatility ignores.

Validation: every point equals an independent solution of the same linear programme by SciPy's HiGHS solver; no portfolio on a brute-force grid over the simplex with at least the same expected return has lower CVaR; each point's reported CVaR and VaR equal the closed-form historical values of its weights; returns increase and CVaR never decreases along the frontier; and no mean-variance portfolio has lower CVaR than the mean-CVaR frontier at or below its return.

Solving and verification

Problems are solved with CVXPY (Diamond & Boyd, 2016) using the Clarabel interior-point solver (Goulart & Chen, 2024), with SCS as a fallback. After solving, Ardentum:

  1. removes round-off below 10−810^{-8}, clips to bounds and renormalises;
  2. re-checks every constraint (tolerance 10−610^{-6}); a violating solution raises an error and is never shown;
  3. computes diagnostics: which constraints bind, and their shadow prices (dual values) where they are interpretable.

Pre-checks catch common infeasibilities with a specific message (e.g. maximum weights that sum to less than 100%, a minimum ESG score above the best-scoring asset, a target return above the attainable maximum).

Validation

The optimiser is tested against independent answers: closed-form global minimum-variance, tangency and utility portfolios; Merton's frontier; SciPy SLSQP with multiple starts; PyPortfolioOpt; brute-force grid search; and the Karush–Kuhn–Tucker optimality conditions.

Explanations

Explanations are derived from the optimality conditions, so each one is a checkable fact:

  • Minimum volatility. Every held, unconstrained asset has the same marginal variance (Σw)i(\Sigma w)_i; an asset left out has a marginal variance at least as high, so adding it would raise risk.
  • Maximum Sharpe. Held, unconstrained assets satisfy μi−rf=βi(μp−rf)\mu_i - r_f = \beta_i(\mu_p - r_f) with βi=(Σw)i/(w⊤Σw)\beta_i = (\Sigma w)_i/(w^\top\Sigma w). An asset left out has an expected return below this required return: its return does not compensate for the risk it would add.
  • With an ESG tilt the objective uses the ESG-adjusted returns, so these conditions hold for the adjusted returns; the required return is translated back into plain terms so it can be compared with the asset's expected return.
  • Each statement is made only when it is true at the solution. When an asset left out would improve the objective on return and risk alone, a binding constraint is what keeps it out (a full sector, the minimum ESG score, the tracking-error or gross-exposure limit), and the explanation names it; held weights shaped by a binding constraint say so too.
  • Assets at their maximum weight would be held in larger size without the limit; binding constraints are listed with their shadow prices.

Weight stability

Optional: the return history is resampled with replacement (bootstrap), inputs are re-estimated and the problem re-solved many times with a fixed seed. The 5th–95th percentile range of each weight shows how much the portfolio depends on estimation noise (in the spirit of Michaud, 1998). Wide ranges are a warning sign about the inputs.

Limitations

Single-period model; returns summarised by mean and covariance only (no skewness, fat tails or regime changes); no transaction costs, taxes or liquidity limits inside the optimisation; estimates treated as known.