The Arithmetic Average Needs Simulation
The model has no closed form for the arithmetic average-price call, so it is priced by simulation; using the geometric average, whose price is known, as a control cuts the sampling error by a large factor at the same number of paths.
The question
Most contracts average the prices with equal weights, the arithmetic average. Under the model of this book that average has no closed-form price, because a sum of lognormal prices is not lognormal. What does the engine do instead, and how reliable is the number?
The engine draws many price paths, computes the discounted payoff on each and takes the mean. Such a mean has a sampling error. The lesson shows one trick that shrinks it: use a related option whose price is known. The inputs are assumptions of the lesson.
Work it by hand
The geometric average of a path is close to its arithmetic average, and the geometric call has a closed form. So on the same paths, the geometric payoffs share the luck of the draw with the arithmetic ones. If the mean of the simulated geometric payoffs is above the exact geometric price, the draw was lucky, and the arithmetic mean is probably too high by about as much.
A made-up example with three paths. The arithmetic payoffs are 6, 0 and 9, mean 5. The geometric payoffs are 5, 0 and 8, mean 4.33, and suppose the exact geometric price is 4. The geometric mean is 0.33 too high, so the controlled estimate is 5 - 0.33 = 4.67.
The correction costs nothing in the model: the geometric price is known. What it buys is the standard error, shown in the demo.
Run it
Lines 2 and 3 build the arithmetic and the geometric average-price call with fixings fixings. Line 4 prices the arithmetic call with pricing.monte_carlo_plain(paths, seed), a plain simulation, and line 5 with pricing.monte_carlo(paths, seed), which also uses the geometric control and pairs of opposite paths, called antithetic. Line 6 prices the geometric call by the closed form. Line 13 returns that closed form in whole cents, rounded with lmf.round: 594, a lower bound that both estimates should exceed.

let m = model.black_scholes(spot, rate, 0.0, vol);
let ar = instrument.asian_call(strike, 1.0, "arithmetic", fixings);
let ge = instrument.asian_call(strike, 1.0, "geometric", fixings);
let plain = pricing.price(ar, m, pricing.monte_carlo_plain(paths, seed));
let ctrl = pricing.price(ar, m, pricing.monte_carlo(paths, seed));
let exact = pricing.price(ge, m, pricing.analytic()).price();
lmcode_return_put("plain_price", lmf.round(plain.price(), 4));
lmcode_return_put("plain_error", lmf.round(plain.stderr(), 4));
lmcode_return_put("control_price", lmf.round(ctrl.price(), 4));
lmcode_return_put("control_error", lmf.round(ctrl.stderr(), 4));
lmcode_return_put("geometric", lmf.round(exact, 4));
lmcode_return_put("smaller", lmf.round(plain.stderr() / ctrl.stderr(), 0));
let answer = int(math_round(lmf.round(exact, 2) * 100.0));
{
"answer": 594,
"plain_price": 6.149,
"plain_error": 0.0855,
"control_price": 6.1565,
"control_error": 0.0021,
"geometric": 5.9404,
"smaller": 41
}With 10,000 paths, 12 fixings and the seed 42 the recording shows in the picture a plain estimate of 6.149 with a standard error of 0.0855, a controlled estimate of 6.1565 with a standard error of 0.0021, and an error ratio of 41. The engine switches on both tricks together, so the factor 41 is their joint effect. Another seed gives other estimates.
You can change paths, seed, fixings and the market inputs. The product of the two counts is limited: 100,000 paths with 52 fixings stops line 4 with "Line 4: monte carlo: paths times fixings must be at most 4000000, got 100000 x 52 = 5200000"; 0 paths stops it with "Line 4: monte carlo: paths must be 1..4000000, got 0", and 0 fixings stops line 2 with "Line 2: fixings must be 1..10000".
One path stops line 4 with "Line 4: monte carlo: the standard error needs at least 2 paths, got 1", and 2 to 15 paths stop line 5 with "Line 5: pricing.monte_carlo: paths must be 16..100000000".
A seed of 0 or less stops line 4 ("Line 4: pricing.monte_carlo_plain: seed must be 1..2147483647 (0 would mean a clock-based seed), got 0"). More than 365 fixings in the year stop line 4 with "Line 4: Asian fixings fall on the same day: use fewer fixings or a longer maturity".
A volatility of 0 or less stops line 1 and a strike of 0 or less stops line 2. With 1 fixing the two averages are the same price, the control error is 0 and the error ratio is a huge meaningless number; with a strike so high that every payoff is 0 the ratio is 0.
50,000 paths at 12 fixings ran in 1.5 seconds on the author's host.
Your turn
The lists arith and geo hold the discounted arithmetic and geometric payoffs of the same paths, one entry per path, and geo_exact is the geometric option's known price. The program below should return the controlled estimate of the arithmetic price in whole cents: the mean of the arithmetic payoffs, corrected by how far the mean of the geometric payoffs is from the exact geometric price. Decide whether it does, and find the candidates that do. The lists are made up and short.
Check runs each candidate on the data shown and on six others.

let total = 0.0;
for (i in range(0, arith.len())) { total = total + arith.at(i); }
let mean = total / float(arith.len());
let answer = int(math_round(lmf.round(mean, 2) * 100.0));
{
"answer": 457
}arith and geo hold the discounted payoffs of the arithmetic and the geometric average-price call on the same paths, one entry per path, and geo_exact is the exact price of the geometric call. The controlled estimate of the arithmetic price is the mean of arith minus (the mean of geo minus geo_exact). Return it in whole cents.
Read the result carefully
The small standard error is about sampling only. It does not touch the model's assumptions, constant volatility and a constant rate, and an estimate with a tiny error can still be a price in a wrong model. The factor of 41 belongs to this option, these inputs and this seed's draw; it is not a promise for other options.
The engine has no switch for the antithetic pairs or for the control alone, so this page cannot separate them. The exercise works on given lists of payoffs, a few paths, and the plain arithmetic of the correction: a real run uses thousands of paths. It describes a model on made-up inputs and is not investment advice.
What a simulated price is, and how its standard error shrinks with the number of paths, is the subject of Monte Carlo Pricing Step by Step.
Recap
- The arithmetic average-price call has no closed form in the model, so it is priced by simulation.
- A simulated price comes with a standard error that shrinks only slowly with the number of paths.
- The geometric payoff, whose price is known, is a control: subtract how far its simulated mean is from the truth.
- The engine's control and its antithetic pairs together cut the error here by a factor of 41.