RSJ Portfolio Create a statistically optimized portfolio

← All posts

2026-11-15

How to Verify Portfolio Optimization Results

How to Verify Portfolio Optimization Results
portfolio optimization modern portfolio theory portfolio correlation portfolio optimization hierachical risk parity minimize volatility minimize semivariance maximize sharpe

How to Verify Portfolio Optimization Results

You asked for a minimum-volatility allocation, and back came a weight vector: one holding at 20%, three at exactly zero, and the rest spread thin. The numbers are precise, the table is tidy, and you have no idea whether any of it is right.

That gap — between a plausible-looking output and a result you can defend — is what verification closes. Verification is not re-running the optimizer and hoping for the same answer. It is checking that the output respects the constraints you set, that the objective value is consistent with the risk model you chose, and that the inputs were the ones you meant to use. This article walks through that check end to end, using RSJ Portfolio’s configuration, selection and recommendation views as the working surface.

Why Verification Matters: From Black Box to Trusted Allocation

An optimizer is a deterministic machine wrapped around assumptions. Feed it a covariance matrix, an expected-return vector, an objective and a set of weight constraints, and it will return the best weights for that specification. If the specification is wrong, the weights are still optimal — just optimal for a question you didn’t ask.

Three failure modes produce plausible but wrong allocations:

  • Overfitting. A short or hand-picked date range fits the covariance estimate to one particular regime. Weights that look great in backtest collapse out of sample.
  • Data errors. Stale prices, missing sessions, or a currency conversion applied to the wrong leg distort the return series. The optimizer dutifully minimizes volatility on a corrupted matrix.
  • Mis-specified constraints. A minimum weight you set as a fraction when you meant an amount, or a bound that silently binds on half the candidate list, changes the answer more than the risk model does.

Investors and quants both need to defend an allocation — to a client, an investment committee, or just to themselves at 2 a.m. The defense is never “the software said so.” It is “here are the inputs, here are the constraints, and here is why the output is the correct response to them.”

What a Verifiable Optimization Result Looks Like

A result you can verify is a result with enough metadata attached to reproduce it. For any allocation, four artifacts are non-negotiable:

  1. The objective function value. The number the optimizer maximized or minimized — portfolio volatility, Sharpe ratio, semi-deviation, CVaR, or whatever the chosen objective produces.
  2. The risk estimator used. RSJ Portfolio offers eight risk models; which one produced the covariance matrix is part of the result, not a footnote.
  3. The weight constraints. Upper and lower bounds, whether shorting is permitted, and any other limits in force during the run.
  4. The resulting weights. The allocation itself, at full precision, not rounded to the nearest percent.

Add the reproduction trail: date range, data provider, and the price-cleaning settings applied before the optimizer ever saw the data.

RSJ Portfolio surfaces these in the recommendation view — the optimizer settings sit alongside the resulting allocation, so the parameters are inspectable rather than buried. Keep one distinction clear as you go:

  • Verifying the mechanics means asking whether the optimizer correctly solved the stated problem.
  • Verifying the data means asking whether the stated problem was the right one to solve.

Both matter. They fail differently, and they are checked differently.

Step-by-Step Verification with RSJ Portfolio

Work backwards from the result. Each step below corresponds to a screen or a setting you can inspect.

1. Confirm the configuration

Start at the configuration screen. The Configuration guide lists the parameters; the Data and currencies page explains the providers and the cleaning pipeline behind them. Check:

  • Data provider — the one you intended, not one selected during an earlier experiment.
  • Date range — long enough to cover more than one regime, recent enough to be relevant. Note the exact start and end dates; you will need them for reproducibility.
  • Local currency — the currency your weights and risk figures are expressed in. For portfolios quoted in several currencies, the conversion path matters.
  • Cleaning settings — how gaps, splits and outliers in the raw prices are handled. Changing these changes the covariance matrix, and therefore the weights.

2. Audit the candidate list

The Selection guide covers symbol search and list building. Confirm every symbol in the list is one you meant to include, that nothing was dropped by a filter, and that no ticker resolves to a different listing than you assumed. A single mis-mapped symbol is enough to shift a correlation-driven allocation.

If you are still choosing candidates, the mechanics of screening for weak correlation are covered separately in How to Scan a Watchlist for Low-Correlation Stocks.

3. Review the optimizer parameters

The Recommendation guide documents the optimizer and its parameters. The Methods and features page lists the full menu. Before you look at weights, confirm:

  • Objective — minimum volatility, maximum Sharpe ratio, minimum semi variance, hierarchical risk parity, or conditional value at risk. Each answers a different question.
  • Risk model — one of the eight available estimators.
  • Weight constraints — the bounds you actually set.

4. Inspect the allocation against its constraints

Now compare weights to bounds, mechanically:

Check Expected outcome
Weights sum to 1 (or 100%) Exactly, to floating-point tolerance
Every weight within its lower and upper bound No exceptions
Weights at a bound Expected in most optimizations — note which ones
Objective value Plausible against a simple benchmark
Number of holdings Consistent with your intent, not just the constraint set

A weight sitting exactly on a bound is the clearest signal that the bound mattered to the solution. Several weights on bounds, or a long tail of zeros, tells you the constraint set is doing more work than the risk model.

5. Export and independently recompute

Bring the weights into a spreadsheet or a script and recompute the portfolio statistics yourself. RSJ Portfolio supports exports for exactly this purpose; the mechanics are in Exporting Optimized Portfolio Weights to a Spreadsheet.

import numpy as np
import pandas as pd

# Column names depend on your export; adjust to match.
weights = pd.read_csv("weights.csv", index_col=0)["weight"]
mu = pd.read_csv("expected_returns.csv", index_col=0)["mu"]
cov = pd.read_csv("covariance.csv", index_col=0)

LOWER, UPPER, TOL = 0.0, 0.20, 1e-6

# 1. Fully invested?
assert abs(weights.sum() - 1.0) < TOL, f"weights sum to {weights.sum()}"

# 2. Bounds respected?
assert (weights >= LOWER - TOL).all(), "weight below lower bound"
assert (weights <= UPPER + TOL).all(), "weight above upper bound"

# 3. Recompute portfolio statistics on the aligned order
w = weights.reindex(cov.index).fillna(0.0).to_numpy()
vol = float(np.sqrt(w @ cov.to_numpy() @ w))
ret = float(w @ mu.reindex(cov.index).to_numpy())

print(f"portfolio volatility: {vol:.6f}")
print(f"expected return:      {ret:.6f}")
print(f"Sharpe (rf=0):        {ret / vol:.4f}")

# 4. Benchmark against equal weight
ew = np.full(len(w), 1.0 / len(w))
print(f"equal-weight volatility: {np.sqrt(ew @ cov.to_numpy() @ ew):.6f}")

If your recomputed volatility matches the reported objective value to a sensible tolerance, the mechanics are consistent. If it doesn’t, the discrepancy is the finding: wrong covariance matrix, mismatched ordering, or a result from a different parameter set.

Before any of this, verify the build itself. The downloads page publishes a SHA-512 checksum alongside the installer filename:

# Compare the printed digest with the one published on the downloads page.
sha512sum ./<installer-file>.exe

Interpreting Results and Handling Edge Cases

Red flags worth stopping for

  • Everything on one or two names. Usually a binding constraint or a risk model producing extreme estimates, not a genuine insight.
  • A long row of zero weights. The candidate list is larger than the effective opportunity set. Either the constraints are too tight or the correlation structure is dictating a small subset.
  • An objective value that looks too good. Extremely low volatility on a short window is the classic overfitting signature. Lengthen the window and see if it survives.
  • Weights that don’t sum to one after export. A rounding or currency artifact, not an optimizer bug — but find it before you trade on it.

Risk estimator sensitivity

The eight risk models are not cosmetic. Re-run the same objective with a second estimator and compare allocations. If the weights swing wildly, the portfolio is being driven by estimation noise in the covariance matrix rather than by any robust property of the assets. That is a finding about the candidate set, not a bug in the software.

Data problems

Missing prices, stale sessions and currency conversion errors all leave fingerprints. Look for suspiciously flat return series, correlations pinned near 1.0 for unrelated names, or a gap in coverage over a known market holiday. The Data and currencies page describes how the cleaning pipeline handles prices and where the local cache sits; if two runs on identical settings disagree, inspect the cache before assuming the optimizer changed.

Sensitivity checks that cost five minutes

  • Shift the date range by a few months at both ends. Stable weights are reassuring; unstable ones are informative.
  • Swap the risk model and re-optimize.
  • Loosen one constraint by a small amount and see how much the allocation moves. Large movement means that constraint was carrying the result.
  • Compare the objective value against equal weight. If the optimizer barely beats naive diversification, say so out loud.

FAQ

How do I know if my portfolio optimizer is producing correct results?

Check that the inputs (data, constraints, objective) are correctly specified and that the output weights respect constraints. Compare the objective value to a simple benchmark, and test sensitivity to small changes in inputs. RSJ Portfolio exposes all parameters and results so you can inspect them directly.

What should I do if the optimizer puts all weight on a few assets?

This often indicates that constraints are binding or that the risk model is producing extreme estimates. Review your weight constraints and consider a different risk estimator. RSJ Portfolio lets you adjust constraints and risk models easily to see the effect.

Can I verify results without re-running the optimization?

Yes, by checking that the reported weights satisfy the constraints and that the objective value is consistent with the chosen risk model. You can also export weights and compute portfolio statistics independently in a spreadsheet.

How does RSJ Portfolio help with verification?

RSJ Portfolio shows the full configuration, the candidate list, the optimizer settings, and the resulting allocation in one place. You can adjust parameters and immediately see the impact, making verification a natural part of the workflow.

Conclusion: Building Confidence in Your Allocation

Verification is a loop, not a checkbox: confirm the configuration, audit the candidate list, read the optimizer parameters before the weights, check the weights against their constraints, then recompute the objective independently. When all five agree, you have an allocation you can explain — and an explanation is the only thing that survives a bad quarter.

Make it a standard step. The extra ten minutes are cheap next to the cost of discovering, six months in, that a currency conversion was applied twice. RSJ Portfolio is a Windows desktop application that keeps the configuration, the parameters and the allocation on the same screens, so verification is inspection rather than archaeology. Start with the getting started guide, then download the installer and run your first allocation through the checklist above.

If you want the statistical background before your next run, the methods and features overview is the right next read.

Related posts

EU label: AI-generated content