RSJ Portfolio Create a statistically optimized portfolio

← All posts

2026-11-19

What Is Semi Variance in Portfolio Optimization?

What Is Semi Variance in Portfolio Optimization?
portfolio optimization modern portfolio theory portfolio correlation portfolio optimization hierachical risk parity minimize volatility minimize semivariance maximize sharpe

What Is Semi Variance in Portfolio Optimization?

Ask ten investors what risk means and most will describe the same thing: the chance of losing money. Then ask a portfolio optimizer, and it will usually answer with variance — a number that counts a +8% month and a −8% month as exactly the same amount of risk.

That mismatch is the whole reason semi variance exists. Semi variance is a risk measure that only counts returns below a target you choose. Gains, however large, contribute nothing. If you have ever looked at a backtest with a respectable volatility figure and still felt uneasy about the drawdown chart, semi variance is the statistic that explains why.

This article covers what semi variance is, how it is computed, where it goes wrong, and how to run a minimum semi variance allocation in RSJ Portfolio.

The Question in Plain Language

Semi variance measures the dispersion of returns that fall short of a target return. Returns at or above the target are ignored — not down-weighted, ignored.

Variance, the classic Markowitz risk term, is symmetric. It squares every deviation from the mean, positive or negative, so a portfolio that swings +12% and −12% scores identically to one that climbs steadily with a few sharp drops. For a risk model that is a feature: variance is easy to estimate, easy to differentiate, and mathematically convenient. For an investor saving for a goal, it is the wrong question. Nobody lies awake worried that their portfolio went up too much.

Two consequences follow:

  • Same variance, different experience. Two portfolios can have identical variance and completely different downside profiles. One loses 3% in a bad month; the other loses 11% twice a decade. The second one is the one people abandon at the bottom.
  • Risk should match the goal. If the goal is capital preservation or funding a liability in three years, the relevant risk is the shortfall, not the total wobble.

That asymmetry is why objective functions matter. RSJ Portfolio lets you pick the optimization objective rather than hard-coding one — minimum volatility, maximum Sharpe ratio, and minimum semi variance are all selectable, so you can compare what each one does to the same candidate list and the same price history.

A Real-World Analogy: The Two Drivers

Imagine two drivers on the same commute, and a telematics device that records every lateral movement of the steering wheel. Driver A makes many small corrections. Driver B holds the wheel steady for miles, then swerves onto the shoulder twice.

Total movement can be identical. The summary statistic — average lateral deviation — may even favor Driver B. But you would not call them equally safe. Variance measures all lane changes. Semi variance measures only the swerves that take you off the road.

Portfolios behave the same way. A strategy that grinds upward with frequent 1% swings is not the same risk as one that is flat for quarters and then drops 15% in a month, even if annualized volatility is the same number. Semi variance captures that by discarding positive surprises entirely: it asks how far below your target the bad outcomes go, and how often.

How Semi Variance Works Under the Hood

Everything hinges on one parameter: the target return, sometimes called the minimum acceptable return (MAR). Only returns below it count.

In words: take each period’s return, subtract the target, keep the negative results, square them, and average. If you weight by probability or by period length, you average the weighted terms instead.

Formally, for returns $r_t$ and target $\tau$:

$$\text{SemiVariance} = \frac{1}{N}\sum_{t=1}^{N} \min(r_t - \tau,\ 0)^2$$

Three details worth knowing:

  1. The square root is a different name. Semi deviation is the square root of semi variance and is expressed in return units, so it is easier to read on a chart. Anyone quoting “downside risk of 6%” is usually quoting semi deviation.
  2. The denominator is a convention. Some implementations divide by all observations, others only by the observations below the target. The absolute number changes; the ranking of portfolios usually does not. Be explicit about which one you use when comparing results.
  3. The measure is differentiable. Square-then-sum keeps the function smooth, which is why semi variance can be dropped into a quadratic-style optimizer as an objective. Absolute downside measures are harder to optimize for the same reason.

Here is the calculation in a dozen lines, so you can check any reported number yourself:

import numpy as np

def semi_variance(returns, target=0.0):
    """Mean of squared shortfalls below the target return."""
    r = np.asarray(returns, dtype=float)
    shortfall = np.minimum(r - target, 0.0)
    return np.mean(shortfall ** 2)

def semi_deviation(returns, target=0.0):
    """Semi variance in return units."""
    return np.sqrt(semi_variance(returns, target))

The interesting part is how differently two series with the same volatility score. This snippet re-standardizes the second series so both have identical mean and standard deviation — only the shape differs:

import numpy as np

rng = np.random.default_rng(7)
n = 2520  # ten years of daily observations

# Symmetric: ups and downs roughly balanced.
sym = rng.normal(0.0004, 0.011, n)

# Negatively skewed: mostly quiet, with a handful of large losses.
skew = rng.normal(0.0004, 0.011, n)
skew[rng.choice(n, 40, replace=False)] -= 0.05
skew = (skew - skew.mean()) / skew.std() * 0.011 + 0.0004

for name, series in {"symmetric": sym, "loss-heavy": skew}.items():
    print(f"{name:10s} vol={series.std():.4f}  "
          f"semi-dev(@0)={semi_deviation(series, 0.0):.4f}")

Same volatility. Different downside. That gap is the entire argument for using semi variance as an objective rather than reporting volatility and moving on.

In RSJ Portfolio, minimum semi variance is one of the selectable optimization objectives. It is computed from historical end-of-day prices, and the risk estimator used underneath is selectable as well — so the objective and the covariance estimate are two separate decisions you make before running the optimizer.

Why It Matters and Common Misconceptions

Semi variance aligns the risk model with how people actually behave. Loss aversion is not a character flaw to be optimized away; it is why capital preservation mandates exist, why drawdown limits get written into investment policy statements, and why investors fire managers after bad quarters rather than good ones.

It also gives you a defensible answer to a practical question: risk relative to what? Variance needs no target, which sounds neutral but just hides the assumption. Semi variance makes the target explicit and lets you set it to zero, to the risk-free rate, or to a required return that matches a real obligation.

Three misconceptions are worth clearing up:

“Semi variance is just volatility divided by two.” It is not. The relationship depends entirely on the target and on the shape of the return distribution. For a symmetric distribution with a target at the mean, semi variance is exactly half the variance — which is probably where the myth comes from. Move the target, or use a skewed distribution, and the ratio drifts away from one half. For a negatively skewed equity series it can be substantially higher.

“Minimizing semi variance always produces a low-return portfolio.” Any risk objective can be pushed to a degenerate corner if you optimize it alone with no other input. Semi variance is not special in that regard. It becomes useful when it is one ingredient among several — combine it with a return requirement, or with weight constraints on individual assets, so the optimizer is choosing how to take risk rather than whether to take any. RSJ Portfolio exposes weight constraints in the recommendation screen for exactly this reason.

“Semi variance is only for extreme risk.” There is a common assumption that downside measures are for tail-risk specialists. In practice semi variance is relevant to anyone who cares more about losses than gains — which is most people, most of the time. CVaR is the tool for the far tail; semi variance is a general-purpose replacement for variance when the symmetry assumption is the part you object to.

Because RSJ Portfolio ships several objectives and eight risk models, you do not have to take any of this on faith. Run the same candidate list under minimum semi variance, minimum volatility, and conditional value at risk, and compare the resulting allocations and their historical downside behaviour. That comparison is a better argument than any article.

Building a Minimum Semi Variance Portfolio with RSJ Portfolio

RSJ Portfolio is a Windows desktop application that builds a statistically optimized portfolio from historical end-of-day prices. The workflow for semi variance is the same as for any other objective — only one setting changes.

Step 1 — Build the candidate list and load prices. Search for symbols in the selection screen and add them to your candidate list. Prices come from the built-in data providers and pass through the cleaning pipeline before they reach the optimizer, so gaps, splits, and stale quotes are handled before the statistics are computed. The cleaned series are cached locally, which makes re-running an optimization with a different objective fast.

Step 2 — Choose the objective. In the recommendation screen, select minimum semi variance as the optimization objective. The alternatives — minimum volatility, maximum Sharpe ratio, hierarchical risk parity, and conditional value at risk — sit alongside it in the same selector. If your definition of risk needs a target return, set it here rather than accepting a default.

Step 3 — Pick a risk estimator and set constraints. The risk estimator is a separate choice from the objective. If you want to limit concentration, add weight constraints on individual assets at this point. This is also where you confirm the date range and the local currency.

Step 4 — Run the optimizer and read the allocation. The result is a set of weights. The point of the exercise is not that the weights look unusual; it is that they were chosen to keep the portfolio’s downside — and the correlation of that downside across holdings — low. Candidates whose losses tend to arrive together get less capital than candidates whose losses arrive at different times.

One practical note on currencies: if your candidate list spans markets, prices are converted to your local currency along the documented conversion path, and semi variance is computed on the converted return series. The risk measure therefore reflects a single base currency rather than a mix.

Semi Variance vs Other Risk Measures

Measure What it penalizes Upside treatment Typical use
Variance All deviations from the mean Penalized equally Classic mean-variance optimization
Semi variance Deviations below a target Ignored Downside-aware allocation
CVaR (expected shortfall) Average loss beyond a tail threshold Ignored Tail-risk limits, stress-sensitive mandates
Minimum volatility Total portfolio variance Penalized equally Lowest possible overall wobble

The distinction between semi variance and CVaR is the one people most often blur. CVaR asks “conditional on a bad day, how bad is it?” and only looks beyond a threshold — typically the worst 5% of outcomes. Semi variance looks at every below-target return, which means it responds to a long stream of small shortfalls as well as to a few large ones. If your concern is the shape of the whole downside, semi variance; if it is specifically the tail, CVaR.

Minimum volatility, by contrast, minimizes total variance and can happily load up on assets whose losses are frequent but modest — a different portfolio from the one minimum semi variance produces, and not necessarily a worse one. For a deeper look at how objective choice changes the answer, see Minimum Variance vs Maximum Sharpe Portfolio: Which Is Better? and Hierarchical Risk Parity vs Minimum Variance: Which Allocation Fits?.

FAQ

What is the difference between semi variance and downside deviation?

Semi variance is the average of squared negative deviations from a target return; downside deviation is its square root. Both focus only on returns below the target, but semi variance is in squared units and is often used directly in optimization because it is differentiable.

Can semi variance be used with any target return?

Yes, the target return (or minimum acceptable return) is a parameter. Common choices include zero, the risk-free rate, or a required return. RSJ Portfolio allows you to set the target when using minimum semi variance as the objective.

Is semi variance a good measure for all asset classes?

Semi variance is particularly useful for assets with skewed or fat-tailed return distributions, such as equities and credit. For symmetric distributions it behaves similarly to variance. It is less informative for assets with very stable returns.

How does RSJ Portfolio handle semi variance optimization with multiple currencies?

RSJ Portfolio converts all prices to a local currency using the conversion path described in its data documentation, then computes semi variance on the converted return series. This ensures the risk measure reflects a single base currency.

Conclusion

Semi variance is not a more sophisticated variance — it is a different question. Variance asks how much a portfolio moves. Semi variance asks how much it moves against you, measured from a target you chose on purpose. For anyone whose actual objective is “don’t lose money I need,” that is the more useful question, and it is the reason minimum semi variance belongs in the objective selector next to minimum volatility and maximum Sharpe ratio rather than in a footnote.

The practical test is cheap: take a candidate list you already trust, run it under two or three objectives, and compare the downside profiles rather than the headline volatility. Start with the getting started guide to set the data provider, cache, and local currency before your first run, then change one setting at a time.

Related posts

EU label: AI-generated content