Speed

A Variance That Moves

The Heston model lets the variance start at v0, be pulled towards theta at speed kappa and be shaken with volatility sigma; its expected value at time t is theta + (v0 - theta) exp(-kappa t), which for the example is 22.62% as a volatility after one year.

The question

Black-Scholes keeps one volatility for the whole life of the option. The Heston model lets the variance, the square of the volatility, move. How does the variance behave, and what does its average path look like?

In the model the variance starts at v0, is pulled towards a long-run level theta at a speed kappa, and is shaken at random with a volatility of variance sigma that is correlated with the price by rho. The example uses made-up numbers: v0 = 0.09, kappa = 1.5, theta = 0.04, sigma = 0.3, rho = -0.7, spot 100, rate 5%. It is a description of an arithmetic model and not investment advice.

Work it by hand

The expected variance at time t is theta + (v0 − theta) e^(−kappa t). It starts at v0 and drifts to theta; the pull is exponential. After one year, with the example numbers: 0.04 + 0.05 e^(−1.5), and e^(−1.5) = 0.2231 to four places, so the expected variance is 0.04 + 0.05 × 0.2231 = 0.0512 to four places (0.051157 unrounded).

A variance is turned into a volatility by the square root: the square root of 0.051157 is 0.2262 to four places, that is 22.62% a year, in whole basis points 2262. The volatility of 30% at the start (the square root of 0.09) has fallen towards the long-run 20% (the square root of 0.04).

Run it

The program takes the parameters, the spot, the rate and a time years. Line 1 builds the Heston model with model.heston; line 2 reads two parameters back with Model.param. The loop from line 5 computes, at 21 times from 0 to 5 years, the square root of the expected variance for three starting variances: the one in v0 (line 9), 0.04 and 0.01; lmf.exp supplies the exponential (line 7).

Line 13 builds an at-the-money call and line 16 prices it in the model. Line 18 computes the same square root at years, and line 19 returns it in whole basis points.

Three curves of expected volatility over five years: each starting at its own level and moving towards one common level.
let m = model.heston(spot, rate, 0.0, v0, kappa, theta, sigma, rho);
let k = m.param("kappa"); let th = m.param("theta");
let ts = float_list(); let high = float_list();
let mid = float_list(); let low = float_list();
for (i in range(0, 21)) {
  let t = 0.25 * float(i);
  let fade = lmf.exp(0.0 - k * t);
  ts.add(t);
  high.add(lmf.round(sqrt(th + (m.param("v0") - th) * fade), 6));
  mid.add(lmf.round(sqrt(th + (0.04 - th) * fade), 6));
  low.add(lmf.round(sqrt(th + (0.01 - th) * fade), 6));
}
let atm = instrument.european_call(spot, 1.0);
lmcode_return_put("ts", ts); lmcode_return_put("high", high);
lmcode_return_put("mid", mid); lmcode_return_put("low", low);
let px = pricing.price(atm, m, pricing.analytic()).price();
lmcode_return_put("atm", lmf.round(px, 2));
let at = sqrt(th + (m.param("v0") - th) * lmf.exp(0.0 - k * years));
let answer = int(math_round(lmf.round(at, 4) * 10000.0));
{
  "answer": 2262,
  "ts": [
    0,
    0.25,
    0.5,
    0.75,
    1,
    1.25,
    1.5,
    1.75,
    2,
    2.25,
    2.5,
    2.75,
    3,
    3.25,
    3.5,
    3.75,
    4,
    4.25,
    4.5,
    4.75,
    5
  ],
  "high": [
    0.3,
    0.272698,
    0.252227,
    0.237134,
    0.226178,
    0.218329,
    0.212767,
    0.208859,
    0.206129,
    0.204232,
    0.202918,
    0.20201,
    0.201384,
    0.200952,
    0.200655,
    0.20045,
    0.20031,
    0.200213,
    0.200146,
    0.200101,
    0.200069
  ],
  "mid": [
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2
  ],
  "low": [
    0.1,
    0.139217,
    0.160714,
    0.173955,
    0.1825,
    0.188147,
    0.191932,
    0.194491,
    0.19623,
    0.197417,
    0.198228,
    0.198784,
    0.199165,
    0.199427,
    0.199606,
    0.199729,
    0.199814,
    0.199872,
    0.199912,
    0.19994,
    0.199959
  ],
  "atm": 12.44
}

The three curves read 20.00% or 20.01% at five years, and the model prices the at-the-money call at 12.44 with v0 = 0.09 (returned as atm).

You can change every number, with these conditions: spot must be positive, or the run stops at line 1 with "model.heston: spot must be positive"; years must not be negative, because the formula looks forward (a negative years returns a meaningless number, and with v0 0.01 and years -5 the run stops at line 19 with "LmfApi.round argument 1 must be finite").

v0, kappa, theta and sigma must be positive, or the run stops at line 1 with "model.heston: v0, kappa, theta and sigma must be positive"; rho must lie strictly between -1 and 1, or it stops there with "model.heston: rho must be inside (-1, 1)".

The engine does not check whether the variance can reach zero: with kappa 0.5, theta 0.04 and sigma 1.0 it still prices the call, at 11.01.

Your turn

A modeller has several parameter sets in three lists: kappas, thetas and sigmas, one entry of each per set. The variance of the model stays above zero when 2 · kappa · theta is greater than sigma squared, a condition named after Feller. The program below is meant to return how many of the sets satisfy it. Decide whether it does, and find the candidates that do. Check runs each candidate on the lists shown and on four others. The sets are made up.

Four values each of kappa, theta and sigma, and the count that the shown program returns.
let count = 0;
for (i in range(0, kappas.len())) {
  let room = lmf.round(2.0 * kappas.at(i) * thetas.at(i), 10);
  let need = lmf.round(sigmas.at(i), 10);
  if (room > need) { count = count + 1; }
}
let answer = count;
{
  "answer": 0
}

The lists kappas, thetas and sigmas hold one parameter set per position. Return how many sets satisfy 2 times kappa times theta greater than sigma squared (strictly greater).

Read the result carefully

The expected-variance formula is exact in the model: it is the average of the model's variance over its random paths, and not the path of any real market. The at-the-money implied volatility of the option is close to an average of the volatility over the life of the option, and is not equal to it.

The engine does not check the condition of the exercise: a set that fails it is priced like any other. The model has five numbers that nobody observes directly, which is a lot of freedom. It has constant parameters and no jumps. It is a description of an arithmetic model and not investment advice.

Recap

  • In the Heston model the variance moves: it starts at v0, is pulled towards theta at speed kappa and is shaken by sigma.
  • Its expected value at time t is theta + (v0 − theta) exp(−kappa t); in the example the square root is 22.62% at one year.
  • The condition 2 · kappa · theta > sigma² keeps the variance above zero; the engine does not enforce it.
  • The model has five parameters that are not observed.