Analytics gallery¶
Author: Artur Sepp / First recorded: 2026-09-14
Examples from OptimalPortfolios. Software citation: CITATION.cff.
The gallery has six previews and 25 teaching exhibits. The previews connect portfolio construction to risk and performance analytics on one synthetic portfolio: OptimalPortfolios estimates risk and constructs targets, qis simulates holdings and computes analytics, and factorlasso fits the sparse factor models. Each teaching exhibit is drawn by the canonical script of its article and illustrates one result of it.
All inputs are synthetic or fixed, except the cryptocurrency exhibit, which is derived from the tracked price panel of its paper. The figures illustrate calculations and implementation conventions; they do not establish historical performance or recommend an allocation or estimator. The previews’ shared provenance record identifies the effective source, inputs, parameters, actual software environment, generation time and visual review; the teaching exhibits have their own manifest. A fixed sample ending in 2025 is separate from the date the image was generated.
Choose an exhibit¶
The six previews simulate one synthetic portfolio end to end:
Question |
Exhibit |
|---|---|
How do growth and drawdowns compare with a synthetic benchmark? |
|
What are the final targets and their estimated risk contributions? |
|
How do decided allocations and realized trading costs evolve? |
|
How does covariance smoothing affect this example? |
|
How do three objectives behave with common risk inputs? |
|
How do estimates compare with a known simulated covariance? |
The 25 teaching exhibits each illustrate one article, in the order of the sidebar:
Question |
Exhibit |
|---|---|
Which observations enter each asset’s classic momentum when monthly and quarterly assets share a formation date, and how is a quarterly signal carried between quarter ends? |
|
What happens to NAV and holdings when a price is missing between rebalancings, on a rebalance date, and at the opening trade? |
|
How much autocorrelation and volatility does unsmoothing restore to an appraisal-smoothed private-asset series? |
|
Do both residual types give each asset the same variance, and how much residual variance does a portfolio of assets sharing an unspanned shock collect under each? |
|
How do capital weights and risk shares differ across equal weight, minimum variance, equal risk contribution and maximum diversification on one covariance? |
|
How does scoring one signal within clusters change the ranking of assets compared with scoring it across the whole cross-section? |
|
Does the signal rank returns, and how stable is its IC? |
|
Are the risk budgets met when a weight bound binds? |
|
What static risk budgets reproduce a target allocation on average, and how far do the weights they imply drift from it date by date? |
|
How do HRP, equal risk contribution and equal cluster budgets divide capital and risk among the blocks of one universe? |
|
Is the maximum diversification portfolio the minimum-variance portfolio of the correlation matrix, rescaled by inverse volatility, and do its held assets share one correlation with it? |
|
Where do minimum variance, utility and maximum Sharpe sit on the frontier? |
|
Do the target-return and target-volatility solvers trace the same frontier, hard and soft? |
|
How do risk aversion and a crash component change the allocation? |
|
What does each added constraint cost in ex-ante tracking error against the benchmark? |
|
Do active weights follow the closed form, and how does IR scale with the TE budget? |
|
How do the overlay sleeve and the portfolio’s model risk and return change as the linear tail floor tightens from non-binding to near its reachable maximum? |
|
What changes when a tracking-error limit becomes a penalty: how far does the solve exceed the limit, and what active return does that buy, as the penalty weight grows? |
|
What does the eigenvalue floor change as two proxies become collinear? |
|
How far do held weights drift from target weights between quarterly rebalancings? |
|
How does raising |
|
How do risk budgets translate into strategic weights, and do the tactical tilts spend the tracking-error budget in the direction of the alphas? |
|
How much does each method allocate to the crypto asset? |
|
How do factor premia and residual adjustments build the CMAs, and what allocation do they imply? |
|
How do factor shocks and option repricing combine in a portfolio stress test? |
Select a preview to open its full-resolution image. The offline quickstart provides a smaller executable introduction, and the examples guide maps broader workflows and their data requirements.
Samples and conventions¶
The first five previews use six assets from the fixed
qis synthetic-universe generator:
US and European equity, Treasuries, investment-grade bonds, gold and commodities.
Seed 20260725 and clean mode (apply_quirks=False) select complete business-day observations
from 4 January 2010 to 31 December 2025. Early history supplies estimation warmup;
the displayed performance window is 1 April 2015 to 31 December 2025.
The sixth preview, covariance estimators, uses the repository’s known-factor simulator, seed 42: four factors, eight assets and 783 business-day observations from 2 January 2023 to 31 December 2025. Its displayed backtest starts on 3 January 2024 after weekly estimation warmup.
Convention |
Applied in the six previews |
|---|---|
Estimation returns |
Weekly Wednesday log returns, with trailing EWMA demeaning |
Covariance units |
Annualized using 52 weekly observations per year |
Construction |
Fully invested, long-only target weights; 35% cap per asset |
Decision and execution |
Quarterly schedules mapped to observed Wednesdays; targets trade one business-day observation later |
Holdings |
qis holds units between trades, so realized weights drift |
Trading costs |
10 basis points of gross traded notional, including entry |
Other costs |
No funding or management fees |
Displayed growth |
Portfolio NAV after costs; the 60/40 reference in the first panel is explicitly gross |
The last target decision is 1 October 2025. That target snapshot differs from holdings at the sample end. Cost bars sum daily cash cost divided by that day’s NAV, expressed in basis points; they measure cost incidence rather than compounded performance drag. The refresh specification records detailed conventions, solver acceptance and independent numerical checks.
Portfolio performance¶
The maximum-diversification portfolio is compared with the fixture’s daily-rebalanced gross 60/40 benchmark. Both series are displayed as growth of 100; drawdown measures the fall from each series’ running peak over the report window.
Sample: 1 April 2015–31 December 2025. The portfolio is net of 10 bp trading costs; the benchmark is gross. This illustrative comparison does not isolate an allocation advantage. Producer: portfolio reports. Related methodology: rolling backtests.
Allocation and risk¶
The upper panel shows decided maximum-diversification weights. The lower panel shows each asset’s contribution to estimated annualized portfolio volatility using the same decision’s covariance. Contributions are measured in volatility percentage points, not portfolio weights.
Decision: 1 October 2025. Weekly log returns, EWMA span 52, annualization factor 52. The 35% asset cap can bind. The estimate describes targets and ex-ante risk, rather than end-of-sample holdings or realized future volatility. Producer: portfolio reports. Related methodology: covariance estimators.
Allocation through time¶
The stacked panel extends each decided target until the following decision for display. It does not plot drifted holdings. The lower panel aggregates realized trading costs by calendar quarter, including the initial allocation.
Sample: 1 April 2015–31 December 2025. Extending the last target to the report end adds neither a new decision nor a trade. Quarterly cost sums use each day’s NAV denominator. Producer: portfolio reports. Related methodology: turnover and transaction costs.
Covariance span sensitivity¶
Five maximum-diversification backtests vary the EWMA span across 5, 13, 26, 52 and 104 weekly observations. Each span affects both trailing demeaning and covariance smoothing. A span is an EWMA parameter, not a half-life or a finite estimation window.
Sample: 1 April 2015–31 December 2025. Assets, constraints, costs and implementation dates are shared. The lower panel sums daily cost/NAV over that common report period. This fixed path illustrates parameter sensitivity; it does not select a preferred span. Producer: span sensitivity.
Portfolio objectives¶
Minimum variance, maximum diversification and equal risk budgets use the same covariance, assets, weight constraints and trade dates. Expected-return estimation is outside this comparison; it covers three objectives driven by covariance.
Sample: 1 April 2015–31 December 2025. The 35% cap can prevent equal target risk budgets from producing equal risk contributions at the decision date. Cost sums include entry. This single synthetic path is not evidence of an objective’s expected market performance. Producer: optimiser comparison. Related methodology: optimization guide and risk budgeting.
Covariance estimators¶
Six estimates feed a common minimum-variance construction: EWMA, Lasso and Group Lasso, each with its specified volatility-normalized variant. EWMA normalization acts on asset-return covariance; factor variants normalize factor covariance only. Group Lasso uses four fixed asset pairs, not clusters inferred from the known loadings.
Backtest: 3 January 2024–31 December 2025. Error snapshot: 1 October 2025. The lower panel measures relative Frobenius error against the known simulated covariance: the Euclidean size of all estimation errors divided by the size of the true matrix. Estimated weekly covariance is annualized by 52; simulated daily truth by 260. Known truth is used for descriptive evaluation and never supplied to portfolio estimation.
All cases fit only data available at their shared decision dates. The simulation has constant loadings/covariance, no return premium and one fixed path. Closely overlapping performance curves and one-date covariance errors do not establish an estimator ranking. Producer: covariance comparison. Configuration: analytics registry.
Mixed-frequency data¶
A teaching exhibit of the mixed-frequency data page. At one formation date, the monthly assets’ classic momentum uses 12 monthly returns ending one month earlier, and the quarterly asset uses 4 quarterly returns ending one quarter earlier; the quarterly signal is carried unchanged between quarter ends.

Sample: deterministic synthetic panel of two monthly series and quarter-end NAVs, December
2018 to December 2024; no simulation. Producer: the exhibit function of
examples/docs/mixed_frequency_data.py.
Configuration: teaching registry.
Incomplete histories¶
A teaching exhibit of the incomplete histories page. A price missing between rebalancings lowers NAV only until the price returns; the same gap on a rebalance date clears the held units without proceeds; a missing opening price leaves that allocation in cash.

Sample: two synthetic assets over four business days in January 2024, with one missing
price; no simulation. Producer: the exhibit function of
examples/docs/incomplete_histories.py.
Configuration: teaching registry.
Universe data and unsmoothing¶
A teaching exhibit of the universe data and unsmoothing page. Appraisal smoothing with a weight of 0.6 on the previous reported return halves the reported volatility of private equity and makes its returns autocorrelated. Unsmoothing lowers the lag-1 autocorrelation from 0.61 to -0.04, against -0.02 for the true returns, and raises the annualised volatility from 10.2% to 20.5%, against 20.4%.

Sample: a seeded synthetic quarterly panel of four assets from December 1989 to December 2024,
seed 19, whose private-equity column is appraisal-smoothed; the simulated true returns are known.
Producer: the exhibit function of
examples/docs/universe_data_and_unsmoothing.py.
Configuration: teaching registry.
Factor covariance with HCGL¶
A teaching exhibit of the factor covariance with HCGL page. Orthogonal and empirical residuals give every asset the same systematic and residual variance; they differ in the residual covariances. Three private assets share a shock that the factors do not span, and an equal-weight portfolio of them has a residual variance of 0.00019 with orthogonal residuals and 0.00040 when the empirical residual correlations enter with full weight.

Sample: synthetic month ends from December 2004 to December 2024, seed 5: four factors, five
monthly and three quarterly assets with known loadings and a shock common to the private assets;
HCGL fit at 31 December 2023. Producer: the exhibit function of
examples/docs/factor_covariance_hcgl.py.
Configuration: teaching registry.
Ex-ante risk contributions¶
A teaching exhibit of the ex-ante risk contributions page. On one covariance, equal weights put 42% of the risk in emerging-market equity; minimum variance has risk shares equal to its weights; equal risk contribution gives each asset 20% of the risk with 45% of the capital in government bonds; maximum diversification holds 67% of the capital in government bonds and 41% of the risk.

Sample: the page’s fixed five-asset, three-factor covariance snapshot; no simulation.
Producer: the exhibit function of
examples/docs/portfolio_risk_analytics.py.
Configuration: teaching registry.
Alpha signals¶
A teaching exhibit of the alpha signals page. Scored across all nine assets, twelve-month momentum ranks the equity-like assets first; scored within each cluster, each group is centred on its own mean, so the strongest bond-like asset rises from fifth to second and the weakest equity-like asset falls to last.

Sample: nine synthetic month-end price paths with constant log drifts, five equity-like and
four bond-like, October 2023 to December 2024; no simulation. Producer: the exhibit
function of examples/docs/alphas_module_readme.py.
Configuration: teaching registry.
Signal diagnostics¶
A teaching exhibit of the signal diagnostics and alpha-rank portfolios page. A synthetic score whose population rank information coefficient is 0.0955 sorts 500 assets into quintile portfolios whose values fan out in rank order, while the monthly rank IC scatters widely around its population value.

Sample: 500 synthetic assets with 240 month-end returns from January 2006 to December 2025,
seed 11. Producer: the exhibit function of
examples/docs/signal_diagnostics_and_profiling.py.
Configuration: teaching registry.
Risk budgeting¶
A teaching exhibit of the risk budgeting page. With slack caps, each asset’s share of portfolio risk equals its budget of 50%, 30% or 20%; capping Equity at 25% leaves no asset at its budget, and the released risk goes to the free assets in proportion to their capital weights, not their budgets.

Sample: the page’s fixed three-asset covariance, solved with slack 80% caps and with Equity
capped at 25%; no simulation. Producer: the exhibit function of
examples/docs/risk_budgeting.py.
Configuration: teaching registry.
Implied risk budgets¶
A teaching exhibit of the implied risk budgets page. As the stock-bond correlation drifts from -0.7 to 0.4 over twelve quarter ends, the implied risk budget of Bonds in a 40/45/15 target rises from -8% to 25%; on the first two dates Bonds hedge the portfolio and no non-negative budget reproduces the target. One static budget vector of about 70.6%, 14.5% and 14.9% reproduces the target only on average: its forward weight in Bonds moves from 59% to 32%.

Sample: three assets with fixed volatilities and a stock-bond correlation drifting from -0.7
to 0.4 over twelve quarter ends from 31 March 2023; no simulation. Producer: the exhibit
function of examples/docs/implied_risk_budgets.py.
Configuration: teaching registry.
Hierarchical risk parity¶
A teaching exhibit of the hierarchical risk parity and cluster risk budgets page. On a universe of four government bonds, two equity markets and two real assets, HRP puts 91% of the capital and 90% of the risk in the bonds; equal risk contribution puts 76% of the capital there for 50% of the risk, and equal cluster budgets 69% of the capital for a third.

Sample: a fixed eight-asset universe of four government bonds, two equity markets and two real
assets with block correlations; no simulation. Producer: the exhibit function of
examples/docs/hierarchical_risk_parity_and_cluster_budgets.py.
Configuration: teaching registry.
Maximum diversification¶
A teaching exhibit of the maximum diversification page. The SLSQP weights of the package and the minimum-variance weights of the correlation matrix, rescaled by inverse volatility and computed by CVXPY, agree for a stylised six-asset universe; every held asset has correlation 0.570 with the portfolio, the inverse of its diversification ratio, and the excluded credit asset has 0.70.

Sample: fixed volatilities and correlations; no simulation. Producer: the exhibit
function of examples/docs/maximum_diversification.py,
run by the teaching-exhibit tool. Configuration:
teaching registry.
Mean-variance objectives¶
A teaching exhibit of the mean-variance objectives page. With a full-investment budget, minimum variance, quadratic utility and maximum Sharpe lie on one frontier: the utility portfolio mixes the minimum-variance and tangency portfolios, and a risk aversion of 6.96 returns the tangency portfolio, whose Sharpe ratio is 0.416.

Sample: fixed expected excess returns, volatilities and correlations of five assets; no
simulation. Producer: the exhibit function of
examples/docs/mean_variance_objectives.py.
Configuration: teaching registry.
Target return and target volatility¶
A teaching exhibit of the strategic allocation page. Minimum variance at a target return, maximum return at a target volatility and the utility form at a penalty weight trace one frontier: a 5% volatility target, a 4.81% return target and a penalty weight of 4.46 return the same portfolio.

Sample: the packaged 19-instrument monthly fixture, with an EWMA covariance (span 36) at
31 December 2025 and equal-Sharpe expected returns; no simulation. Producer: the exhibit
function of
examples/docs/strategic_allocation_targets.py.
Configuration: teaching registry.
CARA utility under Gaussian mixtures¶
A teaching exhibit of the CARA utility under Gaussian mixtures page. A crash component lowers the allocation to crypto at every risk aversion: at a risk aversion of 5, the three-component mixture holds 6.3% in crypto against 7.2% for the Gaussian with the mixture’s own mean and covariance.

Sample: fixed annual parameters of a stylised three-asset, three-component mixture; no
simulation. Producer: the exhibit function of
examples/docs/cara_gaussian_mixture.py.
Configuration: teaching registry.
Minimum tracking error¶
A teaching exhibit of the minimum tracking error page. Starting from the benchmark itself, excluding one asset, capping another, limiting a group and limiting turnover each add ex-ante tracking error, from 0% to 2.06% a year; the right panel shows where the covariance sends the displaced weight at two of the steps.
![]()
Sample: fixed volatilities and correlations of a stylised five-asset universe with a 60/40
benchmark and fixed current holdings; no simulation. Producer: the exhibit function of
examples/docs/minimum_tracking_error.py.
Configuration: teaching registry.
Alpha over tracking error¶
A teaching exhibit of the alpha over tracking error page. Under a 2% tracking-error budget the long-only active weights equal the closed form, and the information ratio stays at 0.336 until a weight bound binds at a 3.82% budget; without weight bounds it does not fall.

Sample: fixed volatilities, correlations, benchmark and alphas of a stylised six-asset
universe; no simulation. Producer: the exhibit function of
examples/docs/alpha_over_tracking_error.py.
Configuration: teaching registry.
Overlay tail floor¶
A teaching exhibit of the overlay tail floor page. A floor changes nothing until it exceeds the unconstrained sleeve’s floor exposure; tighter floors bind at equality, move the sleeve from the carry overlays to the defensive ones, and near the reachable maximum leave it all in one defensive overlay, at a lower model return.

Sample: the page’s synthetic core and four overlays, solved at 90 floors from -0.08 to
0.009; no simulation. Producer: the exhibit function of
examples/docs/overlay_tail_floor.py.
Configuration: teaching registry.
Portfolio constraints¶
A teaching exhibit of the portfolio constraints page. A hard 2% tracking-error row holds the solve at the limit; the same limit as a penalty lets tracking error exceed it by an amount that shrinks as the penalty weight grows, and only the row’s shadow price, 3.33 here, reproduces the forced solve.

Sample: the page’s synthetic three-asset example with a 45/40/15 benchmark, solved with a
hard tracking-error row and at six penalty weights; no simulation. Producer: the exhibit
function of examples/docs/constraints.py.
Configuration: teaching registry.
Solver numerics and outcomes¶
A teaching exhibit of the solver numerics and outcomes page. As two private proxies approach collinearity, the smallest eigenvalue of the covariance falls toward zero and the condition number grows as the inverse of the correlation gap. The eigenvalue floor raises only the smallest eigenvalue, to 1e-10, and caps the condition number at the largest eigenvalue over the floor; the other five eigenvalues are unchanged.

Sample: fixed volatilities and correlations of a six-asset universe whose private pair
approaches a duplicate proxy; no simulation. Producer: the exhibit function of
examples/docs/solver_numerics_and_outcomes.py.
Configuration: teaching registry.
Rolling backtests¶
A teaching exhibit of the rolling backtests page. Between quarterly trades, held weights drift with prices away from the targets in force; each trade, one observation after its decision date, resets them, and the gap peaks the day before a trade.

Sample: a seeded synthetic business-day panel of three assets with weekly EWMA covariances,
minimum-variance targets capped at 60% and eight quarterly trades. Producer: the exhibit
function of examples/docs/rolling_backtests.py.
Configuration: teaching registry.
Turnover and transaction costs¶
A teaching exhibit of the turnover and transaction costs
page. Raising turnover_utility_weight moves the solution along a frontier from the benchmark,
with 30% turnover, to the current holdings, with none; trading stops at a finite weight, 0.3851
in this example, given by the spread of the marginal active risks.

Sample: a synthetic four-asset problem with a 50/20/25/5 benchmark and 40/25/20/15
holdings, solved at 51 penalty weights; no simulation. Producer: the exhibit function of
examples/docs/turnover_and_transaction_costs.py.
Configuration: teaching registry.
ROSAA layers¶
A teaching exhibit of the ROSAA case study. On a synthetic panel with known factor loadings, the strategic allocation meets its risk budgets with capital weights that differ from them, and the tactical tilts against it follow the alphas at a 3% ex-ante tracking error at every quarter end.

Sample: synthetic monthly panel of three factors and eight asset classes, December 2004 to
June 2025, seed 11; quarter ends from December 2014. Producer: the exhibit function of
examples/docs/app_rosaa_multi_asset_allocation.py.
Configuration: teaching registry.
Cryptocurrency allocation¶
A paper-derived exhibit of the cryptocurrencies in diversified portfolios case study, run with the current API on the frozen 2023 panel of the paper. In the all-alternatives template with BTC, the median BTC weight is 5.3% under equal risk contribution, 6.3% under maximum diversification and 10.9% under maximum Sharpe, and CARA utility with three mixture components holds the most.

Sample: the tracked price panel of the cryptocurrency paper, ETF-derived columns only (BTC,
private equity, real estate, commodities, gold and a 60/40 proxy), monthly log returns and 30
quarter ends from 31 March 2016 to 30 June 2023. Producer: the exhibit function of
examples/docs/app_crypto_allocation.py.
Configuration: teaching registry.
Capital market assumptions¶
A teaching exhibit of the capital market assumptions to strategic allocation case study. One loading matrix gives the factor-implied part of each CMA; two one-point residual adjustments, small beside the factor parts, turn a sold-out hedge-fund position into a 3.4-point overweight at a 1% tracking-error budget.

Sample: fixed synthetic loadings, factor premia and residual adjustments of eight asset classes
and four factors; no simulation. Producer: the exhibit function of
examples/docs/app_cma_strategic_allocation.py.
Configuration: teaching registry.
Stress testing with options¶
A teaching exhibit of the stress testing with options page. For a book of stocks with short calls and puts, each Equity scenario’s P&L splits into a delta part, linear in the moves, and a gamma part from full option repricing; the short options lose against their delta line in both directions.

Sample: an offline three-stock book with a fixed three-factor model and conditionally
completed Equity moves; no simulation. Producer: the exhibit function of
examples/docs/stress_testing_with_options.py.
Configuration: teaching registry.
Reproduce and update¶
From a source checkout with the documented contributor environment and C-local setup, one command regenerates all six previews and their supporting tables:
python -m tools.docs_analytics.run --all --output-root <new-C-local-bundle>
Use a new directory below AGENT_LOCAL_ROOT, outside OneDrive and the source tree.
The runner executes offline and records the imported environment and effective source bytes.
Regeneration retains the fixed sample and seed; it does not fetch current market prices.
Distribution versions alone cannot identify uncommitted source edits.
Follow the generation and publication workflow to compare repeated runs, validate the bundle, review each preview at full resolution and article width, and publish the six images with their shared provenance record. Full tables and intermediate output remain C-local. Preview paths are stable; the provenance file identifies their reviewed generation.
Teaching exhibits are drawn by the canonical scripts of their pages and have their own manifest, which records the script, parameters, checks and software versions of each image:
python -m tools.docs_analytics.teaching --all --output-root <new-C-local-bundle>
python -m tools.docs_analytics.teaching --verify
See also¶
Documentation standard: conventions, producer details and refresh workflow.
Constraints: units, alignment and backend support.
Software design: construction, estimation and analytics ownership.
References¶
qis software citation, for simulation, performance and risk analytics.
factorlasso software citation, for sparse factor-model fitting.