Sameen Chand
Markets & quantitative work
Lab

Three small instruments.

Some of the maths from the markets section, running in your browser so you can push on it. The inputs are made up and say so. Nothing here is market data or advice.

Fig. 1

Where the risk comes from

A holding's share of the money and its share of the risk are different numbers. Move the weights and watch them come apart.

Load
Portfolio volatility
–
Weighted-average volatility
–
Largest source of risk
–

Method

  • Risk sharewi(Σw)i / wᵀΣw
  • Minimum volatilityLong-only, by projected gradient descent onto the simplex
  • Risk parityWeights at which every holding supplies the same share of variance

Limits. One fixed covariance matrix, so no estimation error, no fat tails and no correlations that jump in a crash. Minimum volatility ignores expected return completely, which is why it piles into Treasuries.

Assumed correlations

Round numbers chosen to be plausible for each asset class. They are not estimated from price history.

Fig. 2

The same mix on the risk/return plane

The red dot is whatever the sliders in fig. 1 say. The line is the efficient frontier: the most return a long-only portfolio can expect at each level of risk, if you believe the inputs.

Expected return (vertical) against volatility (horizontal). Grey: 700 random long-only mixes. Line: efficient frontier. Circles: single assets. Red: the mix in fig. 1.
Expected return
–
Volatility
–
Against the frontier
–

Method

  • Objectivemax μᵀw − (λ/2)·wᵀΣw
  • ConstraintWeights are non-negative and sum to one, so no shorting and no leverage
  • Frontier120 solves, sweeping risk aversion λ across four and a half orders of magnitude

Limits. The expected returns (μ under each name in fig. 1) are assumptions, and they are the input nobody can measure well. Small changes in μ move the frontier portfolios a long way, which is why minimum volatility and risk parity, which need no μ at all, are used in practice.

Things to try

  • Load minimum volatility in fig. 1. The dot goes to the left tip of the line.
  • Load risk parity. It sits inside the cloud, below the line: it gives up expected return for balance.
  • Push crypto up. The dot slides right much faster than it climbs.
Fig. 3

Monte Carlo against the closed form

Price a European option by simulation and compare it with Black–Scholes, where the answer is known exactly. It is the cheapest honest test of a simulator.

Type
Running estimate and 95% band against sample count (log scale). Dashed line: closed form. Seed 1.
Black–Scholes
–
Monte Carlo
–
Difference
–
Delta
–

Method

  • Terminal priceST = S·exp((r − σ²/2)T + σ√T·z)
  • ErrorFalls as 1/√n, so ten times the accuracy costs a hundred times the samples
  • Antithetic pairsEach sample averages the payoff at z and −z, which cancels part of the noise

Limits. Constant volatility and rate, no dividends, European exercise only. Real option prices show a volatility smile that this model cannot produce. The simulation is here to be checked, not because this payoff needs one.

Things to try

  • Drop to 1,000 samples and reseed a few times. The estimate moves around, but the band should still cover the dashed line about 19 times in 20.
  • Tick antithetic pairs. The band narrows without adding samples.
  • Set the strike to 160. Few paths finish in the money, so the error is large next to the price.

Source: lab.js, with 16 tests against closed-form answers (node --test test/). The full version of fig. 1, on real prices, is the Quant Research Terminal described on the home page.