QQuant, Built

Act III · Derivatives (Q)

Part 16 of 43

Computing Prices

Master'sstarts at this level66 min of film 22 chaptersprerequisites: Part 10, Part 13

The same price can be computed by simulation, by a grid, or by a Fourier integral. Which machine, for which product, to what accuracy?

One option is priced by every method the industry uses, and each method's error is measured rather than assumed. Monte Carlo gives an answer with an error bar that shrinks like one over root n; variance reduction changes the constant, low-discrepancy sequences change the rate, and multilevel changes the cost. American options need regression (Longstaff-Schwartz) and a dual bound to know how wrong the regression is. Greeks are computed three ways and then by adjoint differentiation, which prices a thousand sensitivities for the cost of a few valuations. Finite differences and Fourier methods finish the race.

What you need. Parts 10 and 13; some numerical linear algebra helps.

What you will be able to do

Undergraduate

  • Price an option by Monte Carlo and report a confidence interval.
  • Explain why the error falls like one over the square root of the number of paths.

Master's

  • Apply antithetic, control-variate and importance-sampling estimators; use Sobol points with a Brownian bridge.
  • Price an American option by least-squares Monte Carlo; compute Greeks by bumping, pathwise and likelihood-ratio methods and by AAD; solve the Black-Scholes PDE with a theta scheme; price by the COS method.

PhD

  • Derive the multilevel complexity theorem; the Andersen-Broadie dual bound; convergence of least-squares Monte Carlo as paths and basis functions grow together.

Industry

  • Design an overnight risk run: which method per product, GPU or CPU, and what is validated against what.

Contents

Each chapter has a home level. Choose a track to see what to read and watch: Undergraduate 11 min · Master's 46 min · PhD 66 min · Industry 14 min.

  1. 0One price, many machinesUndergraduate3 min
  2. 1Monte Carlo: an average with an error barUndergraduate2 min
  3. 2Random numbers and sample pathsUndergraduate3 min
  4. 3Variance reduction: controls, mirrors and strataMaster's3 min
  5. 4Variance reduction: importance samplingMaster's3 min
  6. 5Quasi-Monte Carlo: filling space evenlyMaster's3 min
  7. 6QMC on paths: the Brownian bridge and effective dimensionMaster's3 min
  8. 7Multilevel Monte CarloPhD3 min
  9. 8American options I: Longstaff-Schwartz on simulated pathsMaster's3 min
  10. 9American options II: the dual bound, and five assetsPhD4 min
  11. 10Greeks three waysMaster's3 min
  12. 11Adjoint differentiationMaster's3 min
  13. 12Finite differences I: theta schemes and stabilityMaster's3 min
  14. 13Finite differences II: ringing, and the American putMaster's3 min
  15. 14ADI for HestonPhD2 min
  16. 15Fourier I: Carr-Madan and LewisMaster's3 min
  17. 16Fourier II: the COS method, and the raceMaster's3 min
  18. 17Industry: the overnight run, GPUs and adjointsIndustry3 min
  19. 18Quantum amplitude estimationPhD3 min
  20. 19Frontier: interpolation and selected researchPhD3 min
  21. For the researcher: paths against basis functionsPhD4 min
  22. The pricing engine, recap, desk questions, problemsAll tracks3 min

Also on this page: Lecture · Key results · Try it · Lab · Problems · Reading · 中文 · Build the film.

Lecture

The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film. A dashed box stands for a number the film computes when it is rendered (hover over it to see what is computed); the README's figures for each chapter, where it lists them, follow the chapter's text.

One price, many machinesUndergraduate3 min

The models of the last six parts are equations; this part is about turning them into numbers, fast enough and accurately enough for a trading desk.

A one-year Heston call, with zero rates and dividends, priced four ways. These are separately timed runs on a shared CPU, revealed as an illustrative clock reaches each recorded time. The vertical axis needs care. Grid and Fourier points show absolute error against a high-resolution COS reference. Monte Carlo points show one estimated sampling standard error, which excludes the bias of its fifty-step QE discretization. This is not a common total-error guarantee. In this fixed low-dimensional benchmark, Fourier methods reach small reference errors quickly. A path-dependent or many-asset payoff can change the choice of method. Timing and accuracy depend on this implementation, grid and machine.

These rows select the smallest displayed error metric for each method, with the time of that same run. The Monte Carlo row is a standard error; the others are errors against the reference, so they do not certify equally accurate prices. A numerical reference itself also has truncation and floating-point error. Pause and predict. For an unbiased independent-path estimator with fixed variance and constant cost per path, how much work buys ten times smaller sampling standard error? A hundred times. That scaling does not remove time-discretization bias or price-model error.

How we got here. In 1947 John Crank and Phyllis Nicolson published a time-stepping scheme for the heat equation, the grid method this part still uses. Two years later Nicholas Metropolis and Stanislaw Ulam named the method of solving equations with random numbers after a casino: Monte Carlo. In 1967 Ilya Sobol built points more even than random ones. Finance arrived in 1977, when the same journal carried Phelim Boyle's simulation of an option and Eduardo Schwartz's grid for warrants. Trees followed in 1979. Then the modern toolkit: Greeks by simulation in 1996, the fast Fourier transform in 1999, American options by regression in 2001, adjoint Greeks in 2006, and in 2008 both multilevel simulation and the cosine method. Then the hardware: programmable chips in 2011, and in 2021 an estimate of what a quantum computer would need.

The plan, in nineteen chapters. Monte Carlo, its error bar and its random numbers. The tricks that shrink the error. Quasi-random points and the Brownian bridge. Multilevel simulation. American options, bracketed from both sides. Greeks and adjoints. Grids in one and two dimensions. Fourier methods and the race. Then how banks run all this, what a quantum computer would buy, and the frontier.

This part supplies numerical pricing methods for the House. Each method has a defined scope and a different error diagnostic. The practical rule is to distinguish sampling uncertainty, discretization and truncation bias, reference error and model assumptions. A standard error alone does not certify a price's total accuracy.

1Monte Carlo: an average with an error barUndergraduate2 min

Simulate independent terminal prices under Black–Scholes, discount each payoff and average. Here are three fixed-seed runs, from ten to a million paths. The shaded band around the first run is its pointwise normal approximation, estimate plus or minus 1.96 estimated standard errors. It is not an exact finite-sample interval or a simultaneous confidence band over every displayed path count. The full estimates and band remain visible. At large sample sizes, fixed payoff variance gives inverse-square-root sampling error. A hundred times more paths gives about ten times smaller standard error; realized errors and widths fluctuate. This terminal Black–Scholes experiment has no time-stepping bias.

Under the pricing measure, a discounted payoff has expectation V. For independent identically distributed paths, finite absolute first moment gives almost-sure convergence by the strong law. Positive finite variance gives the central limit theorem; consistent sample variance and Slutsky then give an asymptotic pointwise ninety-five percent interval. This is a sampling statement, separate from discretization or model error. Solving the target normal half-width gives n approximately equal to 1.96 squared times payoff variance divided by epsilon squared. The exponent does not contain dimension, but variance and the cost of one path can depend on dimension. With cost c per independent draw and budget C, sampling standard error is approximately sigma times the square root of c over C. Compare variance times cost at a fixed bias target, including any fitting or preprocessing costs when material.

For this discounted call payoff, the original standard deviation is about . A target normal half-width of one cent requires about million independent paths. Across fixed-seed repetitions with paths, the empirical pointwise coverage is percent. That frequency has sampling uncertainty and is not a guarantee for other payoffs. Berry–Esseen requires a finite third absolute centered moment and positive variance; its constant can be large for rare payoffs. If estimator A has twice B's per-draw standard deviation and costs a quarter as much, which has smaller sampling variance at the same large budget? Their variance-cost products tie under those assumptions. Bias, dependence, setup cost and the required total accuracy can change the decision. Next, random numbers and paths.

2Random numbers and sample pathsUndergraduate3 min

Every simulation starts from uniform random numbers, and a normal is made from them. The cleanest way is the inverse transform. Take a uniform u on the vertical axis, read across to the normal distribution function, and down. Do it again and again, and the points pile up into a bell, because the probability of landing below any x is exactly the area the curve gives it.

Box and Muller's construction makes two independent standard normals from two independent uniforms: a radius equal to the square root of minus twice the first log, and an independent uniform angle. All 450 saved pairs are drawn without moving tail observations to an edge. For correlation , use the two rows of this Cholesky factor. The transformed vector has the target covariance because L times its transpose equals that covariance. The sample cloud illustrates the transformation; a finite cloud does not itself prove its distribution or independence.

In symbols. The inverse transform works because an increasing function preserves the event. Box–Muller works because in polar coordinates the Gaussian density factors: the angle is uniform and half the squared radius is exponential, which is minus the log of a uniform. A Brownian path on a grid is then a cumulative sum of scaled normals: a matrix times a vector of independent normals. And here is the hinge for chapter six. Any matrix whose product with its transpose is Brownian motion's covariance, the minimum of the two times, builds paths with exactly the same law. They differ only in which normal does which job.

The bridge assigns the first normal to the endpoint and the next ones to conditional midpoints. At each midpoint, add the conditional standard deviation times an independent normal to the conditional mean. This implementation uses a uniform grid with a power-of-two number of steps. Feeding an identity matrix reveals its linear map L. For eight and sixty-four steps, L times its transpose agrees with the Brownian covariance to the displayed floating-point roundoff. This is a covariance check, rather than a claim of exact arithmetic or bitwise equality between different path constructions.

A path must receive the same random stream when scheduling changes. A sequential generator can use fixed blocks or skip-ahead; this example instead gives path j the Philox key [2026,j]. With the generator, normal transformation and software environment fixed, evaluating these paths in another order reproduces their bits. This demonstrates scheduling reproducibility, not a proof that every chosen stream is statistically independent or bit-identical on every device. The two normal samples have the displayed Kolmogorov–Smirnov statistics. These marginal diagnostics do not establish serial independence or all tail properties. The recorded Python-to-vectorized timing ratio is for this 100,000-payoff benchmark on shared hardware. For unit variances and correlation 0.9, what is the second Cholesky row? It is 0.9 and the square root of 0.19. Next, use fewer paths through variance reduction.

3Variance reduction: controls, mirrors and strataMaster's3 min

A control variate subtracts b times a centered quantity whose expectation is known. Each of these 2,000 points is a discounted Asian payoff pair, with 64 fixings. The geometric payoff varies by path; its expectation has a formula. All saved points and residuals remain visible. Turn b from zero toward the fitted slope. The histograms share fixed bins and divide by all 2,000 observations, so the changing height represents concentration rather than a separate normalization. Across five original 20,000-path runs, the mean reported geometric-control variance ratio is , with mean correlation . These are empirical summaries. The stock-control ratio is in this example. Gains depend on payoff, model and the cost of producing the control.

For a fixed coefficient, expanding the variance gives a quadratic in b. If the control variance is positive, its population minimum is covariance divided by control variance, leaving the factor one minus squared correlation. Estimating b from the same observations may introduce finite-sample bias; a coefficient fitted on an independent pilot remains unbiased when frozen for production. For scalar monotone payoffs, antithetic pairing can give negative correlation. At equal payoff evaluations, the variance ratio is one over one plus that correlation: about two for this call, whose measured correlation is . Stratification with independent samples inside strata and proportional allocation removes the between-strata component of variance. Integer allocation and setup costs still matter. For the straddle, the measured mirror correlation is ; pairing increases variance at equal evaluations in this benchmark.

Place one uniform draw in each of sixteen equal strata. The histograms use five hundred repeated sixty-four-path call estimates, with common bins and a common fraction-of-runs scale. They retain the full saved range. In a separate two-hundred-replicate experiment with four thousand and ninety-six paths, the empirical variance ratios are for sixteen strata and for two hundred and fifty-six. The sixty-four-dimensional Asian's Latin-hypercube ratio is , measured over one hundred replicates of one thousand and twenty-four paths. These finite ratios are not universal gains. Moment matching changes the joint sampling law and can bias nonlinear estimates; setup and transform costs also matter.

The call code mirrors normals or subtracts a fitted slope times the discounted stock's deviation from its known expectation. The zero-dividend case gives that expectation as today's spot. Same-sample slope fitting can introduce finite-sample bias; an independent frozen pilot is one way to avoid it. Twenty seeds with two hundred and sixty-two thousand one hundred and forty-four paths give empirical RMSE for plain simulation, for mirrors and for the stock control. These estimates have finite-replicate uncertainty and omit setup-time comparisons. Very large variance reductions require a particularly close control and are not promised for every product. Next, importance sampling and proposal risk.

4Variance reduction: importance samplingMaster's3 min

A call struck at one hundred and sixty pays in the normal tail, about one and a half percent of these draws. Importance sampling shifts the normal and applies the exact likelihood ratio. The expectation is preserved when support and integrability conditions hold. These are empirical variance ratios from four hundred thousand common normals on a finite grid. The strike-centred shift gives a ratio of ; the best tested shift, , gives . This is not an exact global optimum. At shift five the recorded ratio is ; at more extreme shifts it collapses. The full curve is shown, including ratios below one. Very rare large weights can be missed, so a favourable sample ratio is not an accuracy guarantee. The tiny weight effective sample size is a warning about the proposal, rather than a payoff-specific error bar.

Multiply and divide by a proposal density positive wherever payoff times the original density is nonzero, with the required moments finite. Cauchy–Schwarz gives a variance-minimising density proportional to absolute payoff times density. Its variance is zero for a constant-sign payoff, but normalising it requires the unknown integral. For this nonzero call and a normal shift, the second moment is strictly log-convex and coercive, giving a unique minimiser. Convexity alone would not be enough. Cross-entropy instead fits the payoff-weighted target density by a Kullback–Leibler criterion. For a normal proposal this yields a weighted mean. It is a different objective from variance minimisation. Weight effective sample size has population fraction exponential minus theta squared, provided independent proposal draws represent the weight distribution. It measures weight concentration, not the precision of every payoff estimate.

Five pilot seeds start at zero shift. One cross-entropy update lands between and ; the second between and . The payoff evaluation includes the strike. What is learned is a useful shift without knowing its optimal value in advance. Cross-entropy minimises a divergence, so it need not find the variance optimum. Freeze the learned proposal and use an independent production sample to retain ordinary conditional unbiasedness. In the separate fixed-shift House example, the estimated standard error changes from to . This is a case-specific sampling comparison, with pilot work and rare-weight uncertainty considered separately. For path-dependent payoffs, a useful proposal may shift the whole Brownian path toward a likely paying route. Shift too far and the error can grow. Next, spread points more evenly.

5Quasi-Monte Carlo: filling space evenlyMaster's3 min

Two hundred and fifty-six pseudo-random points leave visibly uneven gaps. The first two hundred and fifty-six Sobol points cover this projection more regularly. Finite point sets still have gaps. For suitable smooth functions, structured points can improve integration substantially, but the benefit depends on the integrand and the construction. We will separate deterministic discrepancy bounds from randomized sampling uncertainty.

The first sixteen points of this two-dimensional Sobol construction have a precise property. Partition the square into aligned dyadic boxes: first sixteen columns. Each has one point. The other dyadic factorizations, eight by two, four by four, two by eight and sixteen rows, retain one point per box. This does not hold for every translated rectangle or arbitrary shape of area one sixteenth. In the displayed random four-by-four partition, boxes are empty and are crowded. Digital net parameters depend on dimension and construction. The aligned-box balance helps explain small discrepancy, rather than guaranteeing a payoff error by itself.

Star discrepancy measures the largest count-versus-volume gap over origin-anchored boxes. Koksma–Hlawka bounds integration error by star discrepancy times finite Hardy–Krause variation. Many option integrands after an inverse-normal transform fail that variation condition, so this is not a direct universal pricing bound. Low-discrepancy constructions have useful fixed-dimension asymptotic rates with dimension-dependent constants. There is no universal crossover at exponential dimension. The L2-star discrepancy measured next is also different from the supremum star discrepancy in this inequality. Van der Corput reverses binary digits: one maps to a half, two to a quarter, three to three quarters. Sobol uses binary generating matrices across coordinates. SciPy uses Joe and Kuo direction numbers. These structural facts do not replace checking the actual integrand.

These are measured L2-star discrepancies, rather than payoff errors or the supremum discrepancy of the theorem. In two dimensions the fitted Sobol slope is , compared with for pseudo-random points. For the displayed sixteen-dimensional sets and these sample sizes, the low-discrepancy constructions have not overtaken random points on this measure. A finite plot does not establish a universal dimensional crossover or an integration-error law. Halton coordinates twenty-nine and thirty show stripes here; Sobol with these direction numbers fills this projection more regularly. Projection quality matters, together with how the payoff depends on the coordinates.

Randomized scrambling preserves net structure while allowing independent replicate estimates. Here ten scrambles each use one thousand and twenty-four points. Their sample standard deviation measures replicate dispersion; dividing by root ten estimates the standard error of their average. The displayed 1.96 interval is an approximate normal interval, not a finite-sample coverage guarantee. Should we discard the first point to avoid an infinite inverse normal? In this smooth two-dimensional example, dropping it increases empirical root mean square error by times at sixty-four points and times at four thousand. These ratios are example-specific. Preserve powers of two. Ideal continuous scrambling hits zero with probability zero, but finite-bit implementations can return zero. The House normal transform clamps endpoints at one trillionth, a tiny change to the transformed integrand that should be disclosed. Next, coordinate ordering for long paths.

6QMC on paths: the Brownian bridge and effective dimensionMaster's3 min

A covariance factor maps independent normals into a Gaussian path with the required joint law. Different factors need not give identical paths from identical inputs. Across is time; back is the input coordinate; height is its path contribution. Step construction gives equal increment variances, but early increments affect more dates and therefore contribute more to a time average. The bridge assigns the first normal to the endpoint, then the midpoint and successively finer conditional points. Principal components order the covariance eigenmodes by path energy. For this linear sixty-four-date Brownian average, the first normal carries percent of variance with steps, with the bridge and with principal components. These shares describe the linear average, not the full nonlinear Asian call.

Watch the bridge build one path from sixty-four normals. The first fixes the end point. The second, the midpoint, given both ends. Then the quarter points, the eighths, and so on, each new point drawn around the straight line between its neighbours. After eight normals the shape is already there; the last thirty-two only add wiggles. That is the order quasi-random points want: their best coordinates, the first few, now decide the most.

For a finite-variance function of independent product inputs, ANOVA splits the function into orthogonal coordinate-subset components. Truncation dimension asks how many leading coordinates explain ninety-nine percent of its variance. It depends on both the payoff and the factorization. For a linear Brownian average, the coordinate weights give the shares exactly through their squared magnitudes. This is an illustration, rather than an ANOVA calculation for the nonlinear Asian option. Principal components maximise leading-mode discrete path energy. Grid eigenvalues divided by sixty-four approximate the continuous covariance-operator eigenvalues shown. PCA does not maximise variance captured for every payoff: a rotation targeted specifically to a linear average can put all its variance into one coordinate.

On this sixty-four-fixing Asian call, the plot shows sample standard deviations over twenty independent replicates. These measure sampling dispersion, rather than total error or a confidence interval; discretization and transformation bias remain separate. Stepwise Sobol records at four thousand and ninety-six paths and at sixteen thousand. At the largest sample size the bridge reaches , and PCA , compared with for random paths. PCA needs precomputation and a dense matrix product per path; the bridge has a cheaper structured transform. Method choice depends on payoff and workload. The mortgage-security work of Paskov and Traub, followed by the effective-dimension explanation of Caflisch, Morokoff and Owen, helped establish this approach in finance. The linear-average shares suggest why coordinate ordering matters, but do not prove the cause of every finite-sample stall in this nonlinear payoff. Next, multilevel simulation.

7Multilevel Monte CarloPhD3 min

Time-stepped simulation has sampling noise and discretization bias. Multilevel Monte Carlo allocates work across resolutions. The panels show stock paths, with fine and coarse increments coupled through the same Brownian noise. The terminal stock differences become small in this example. One path is illustrative; the method relies on the variance of payoff corrections across many coupled paths. The finest-grid expectation equals a coarse expectation plus successive payoff corrections. Cheap coarse estimates get many paths, while small-variance fine corrections need fewer. The displayed allocation targets a one-cent error budget using estimated variance and bias, rather than certifying the realised total error.

The expectation telescopes. With unbiased independent level estimates, mean square error is the sum of level variances divided by sample counts, plus finest-level bias squared. Ignoring integer rounding, a Lagrange multiplier allocates paths proportional to the square root of variance divided by cost. Giles's complexity theorem also assumes a weak-bias rate alpha, positive variance and work exponents beta and gamma, and alpha at least half the smaller of beta and gamma, together with its regularity and allocation conditions. The geometric sum then gives the three displayed complexity regimes. For suitable Lipschitz payoffs and regular SDEs, Euler strong order one half yields the familiar beta-one bound. Scalar or commutative Milstein can give beta two. Standard Monte Carlo costs epsilon to minus two minus gamma over alpha; epsilon to minus three is the case alpha equals gamma equals one. These are conditional rates, not properties of every option.

Here the adaptive loop targets a one-cent error budget. Pilot samples estimate correction variances, and the allocation formula supplies the path counts. The last correction mean, with a weak-rate assumption, supplies a bias proxy. If it is too large, add a level and repeat. This diagnostic can underestimate remaining bias; passing it is not a guarantee of total mean square accuracy. The first seed stops at levels. Four saved seeds have final work differing by percent. That is a small reproducibility check on these runs, rather than proof of stability for every payoff or tolerance.

The whole trick is one line of the House's code. The coarse path's increments are the fine path's, summed in pairs: the same noise, so the two paths stay close. Run it, and the variance of the corrections falls from at level zero to at level .

The left comparison counts estimated simulated steps, not measured seconds. Standard work is estimated on the same finest grid and error budget; it is not a matched, independently verified total-RMSE experiment. The recorded work ratio at one cent is . For this European call the fitted correction-variance exponents are for Euler and for Milstein. What happens to epsilon squared times work when beta exceeds gamma? Under the theorem's assumptions it remains bounded as tolerance shrinks. Here Euler's displayed product goes from to , and Milstein's from to . Finite-sample allocation noise and bias estimates still matter. Randomized-level estimators can remove discretization bias using proper tail weights. Finite variance and finite expected work require suitable tail and regularity conditions; beta greater than gamma helps meet them, but is not sufficient by itself. Next, exercise policies learned from simulated paths.

8American options I: Longstaff-Schwartz on simulated pathsMaster's3 min

This put can exercise on twenty-five dates, so it is a Bermudan approximation to an American contract. The House simulates two hundred thousand fitting paths; the left panel shows one hundred and fifty without clipping. One date before expiry, take in-the-money paths and their realised discounted cash flows from waiting. The right panel shows the first three hundred saved observations at each date. A cubic regression estimates continuation; exercise where immediate payoff exceeds the fit. The polynomial is drawn over the observed spot range. Step backward and update cash flows under the fitted rule. The common axes retain all selected observations and fitted values, including tails. The dashed continuous-exercise tree boundary is a comparison from a different exercise schedule, rather than exact truth for this twenty-five-date policy. Sparse exercise-region observations, basis choice and Monte Carlo noise all affect the fitted boundary.

On these finite dates, dynamic programming gives the Snell envelope. Conditioning on spot is valid here because spot is the Markov state; regression theory also requires suitable square-integrable variables. Conditional expectation is the best mean-square predictor. A basis approximation is fitted by least squares, written with a pseudoinverse to allow rank deficiency. Longstaff–Schwartz uses realised policy cash flows as regression targets. Our separate value-regression illustration can introduce upward bias by maximising noisy values; this is not a universal verdict on every Tsitsiklis–Van Roy algorithm. Conditional on a fixed fitted policy, its expected discounted payoff is no greater than the optimal value. A fresh-path Monte Carlo estimate still has sampling error and can lie above the reference. In-sample fitting means have no such lower-bound guarantee. Consistency as basis and sample sizes grow requires additional conditions.

Each training size and polynomial degree has five fitted seeds. All policies share the same evaluation paths, independent of fitting but reused across comparisons; these are not an untouched final holdout. Bands show seed minima and maxima, not confidence intervals. The degree-one mean is . The best displayed degree at one hundred thousand fitting paths is , and at one thousand it is ; finite comparisons do not identify a proven optimal degree. The reference uses a five-thousand-step tree with the same twenty-five exercise dates. The separate two-hundred-thousand-path fit evaluated on four hundred thousand fresh paths gives plus or minus one estimated standard error, . The value-regression variant has in-sample mean ; it illustrates sensitivity to regression targets, rather than certifying an ordering of algorithms. Why fit only in the money? For this nonnegative put, an out-of-the-money state does not strictly benefit from immediate exercise, so focus fitting on the exercise decision region. Next, dual upper expectations and their noisy estimates.

9American options II: the dual bound, and five assetsPhD4 min

An independently evaluated fitted policy supplies a lower expectation. To study an upper expectation, follow an outer stock path. This illustration selects the first path with a positive payoff from up to forty candidates, so it is not a representative draw. Fresh inner simulations estimate the fixed policy's conditional continuation values. The ideal exact conditional values define a martingale; the plotted noisy process need not itself be a martingale in the enlarged simulation filtration. Track discounted payoff minus that noisy process and its running maximum. This selected path reaches . With conditionally unbiased inner estimates and the required independence, Jensen's inequality makes the average nested maximum upward biased relative to the ideal dual expectation. A finite average has Monte Carlo error and is not a sure upper bound.

On a finite exercise grid, suitable integrability and a martingale starting at zero give optional stopping. A stopped discounted payoff minus that martingale is no greater than its path maximum. Optimising over integrable martingales gives the dual value, attained by the Snell envelope's Doob martingale under the standard conditions. A fixed policy's exact conditional value process supplies an admissible martingale. Nested simulation estimates those conditional values, rather than making every noisy path an exact martingale. Conditional on the outer path, unbiased inner noise and convexity of the maximum give the displayed Jensen comparison. More inner work can reduce nested noise, but individual estimates need not fall monotonically. Both upper and lower estimates have Monte Carlo uncertainty; their observed gap also includes dual looseness and inner noise, rather than only policy suboptimality.

Here the green line is the fixed fitted policy evaluated on four hundred thousand fresh paths: , with estimated standard error . It replaces the in-sample mean, which is not a lower-bound estimate. The nested upper-expectation estimate is with fifty inner paths and with . Red bars show two estimated outer standard errors; they do not remove nested bias. A five-thousand-step tree on the same twenty-five exercise dates gives . Sampling noise and finite tree error mean that this number is not required to lie between every pair of point estimates. The separate continuous-exercise tree and PDE approximate a different, more flexible contract.

This outer loop advances stock paths, estimates continuation with fresh inner draws, updates the noisy policy-martingale approximation, and records the maximum adjusted payoff. The saved experiment uses four hundred outer paths at each inner budget. The standard errors describe outer dispersion; the inner approximation contributes additional upward bias in expectation under the stated construction.

This Bermudan call pays on the largest of five stocks at nine possible dates. A tensor grid with one hundred nodes per asset would have ten billion nodes per date; that is an illustrative grid choice, not a universal requirement. LSM uses fifteen engineered basis functions. On two million evaluation paths, the policies fitted with two thousand, twenty thousand and two hundred thousand paths give , and . Part seventeen's network policy is evaluated on one million paths and gives . It avoids choosing a polynomial basis, but still uses engineered features, architecture and training choices. The difference is , with two combined evaluation standard errors ; this comparison excludes training uncertainty and does not prove equivalence. Becker, Cheridito and Jentzen report to with a different implementation and budget. A wide observed lower-to-upper gap may reflect policy loss, dual looseness or inner noise. Increasing inner work is a useful diagnostic, while retaining outer uncertainty. Next, Greeks.

10Greeks three waysMaster's3 min

A central bump reprices at spot plus and minus h. This surface shows root mean square delta error over thirty seeds, rather than a standard error or confidence interval. Every saved error is retained on the logarithmic height scale. With independent random numbers, dividing a noisy price difference by a small h amplifies noise; large h introduces finite-difference bias. Common random numbers strongly reduce the left wall for this Lipschitz call payoff. The finite tested small-bump region is flatter. It does not imply that every arbitrarily tiny bump works: rounding, cancellation and payoff regularity still matter.

If the price has three suitable derivatives, a central bump has leading bias of order h squared. With independent draws and nonzero leading constants, balancing bias and variance gives optimal h of order n to minus one sixth, and RMSE of order n to minus one third. Common-number payoff differences can have variance of order h squared for a regular Lipschitz reparameterization; a digital generally behaves differently. Pathwise differentiation exchanges derivative and expectation only under suitable domination and integrability conditions. For this call those conditions justify the indicator formula. The displayed likelihood-ratio identity assumes no explicit parameter dependence in the payoff and a regular density with appropriate support. Otherwise direct derivative or boundary terms must be included. Malliavin integration by parts constructs path-space weights under nondegeneracy and integrability conditions. It extends the toolkit, rather than guaranteeing a usable weight for every model and payoff.

The table uses two hundred thousand paths and displays estimates plus or minus one estimated sampling standard error. Bump bias is separate. For this call the methods are close to the analytical delta; pathwise and common-number bump estimators have similar dispersion. For the cash-or-nothing digital, a continuous terminal distribution gives path derivative zero almost surely, but its expected payoff changes with spot. Interchanging derivative and expectation fails. In this specific benchmark the likelihood-ratio standard error is times smaller than the common-number bump with h equal to one. This is not a universal ranking.

The digital payoff is a step. Its ordinary derivative is zero away from the strike and undefined at the strike. The arrow represents a Dirac distribution, not an infinite ordinary slope. With continuous terminal stock prices, the almost-sure zero path derivative therefore misses the derivative of expected payoff. A regular likelihood-ratio method differentiates the density instead. Hybrid pathwise and score estimators can also handle a call's gamma under suitable conditions. A tiny bump with independent price simulations magnifies sampling noise roughly as one over h in standard deviation, before other numerical effects. Next, reverse differentiation of the implemented pricing code.

11Adjoint differentiationMaster's3 min

Adjoint differentiation: a scalar-output gradient in one reverse sweep. Central bumping uses two additional prices per input. Reverse differentiation computes a scalar-output gradient with work proportional to the executed tape, whose own cost grows with the problem. Here the twenty-three tape nodes are laid out left to right across two rows. The forward pass records operations and values for one call path at fixed normal input. Starting from output adjoint one, the reverse pass visits nodes in reverse order and accumulates local chain-rule contributions. All five input derivatives appear together. These are single-path derivatives, becoming expectation Greeks only when derivative and expectation may be exchanged. The derivative with respect to time to maturity is opposite to calendar theta when other conventions match. Differentiating discrete code and branches does not automatically deliver a continuum-model, calibration or optimal-stopping Greek.

The chain rule is a product of Jacobians. Forward mode propagates one input direction per sweep. Reverse mode propagates one scalar output adjoint, giving all input components in one sweep. For many outputs, additional sweeps may be needed. Each tape edge contributes a local chain-rule update. Under the usual elementary-operation cost model, this makes gradient work proportional to the tape's work, plus output storage. This cheap-gradient principle is not a universal three-to-five wall-clock ratio. Tape construction, kernels, memory, recomputation and differentiation of calibration or stopping decisions all matter. For a two-thousand-input scalar price, central bumps require four thousand additional evaluations; reverse work is controlled by the executed computation, with storage or checkpointing costs.

The House prices an Asian option with fifty fixings and twenty thousand paths on the same autodiff: ten lines, and one call to backward. All five sensitivities agree with central bumps, and the sweep cost times one price, against for bumping. With five inputs that is a modest saving. The point is what happens with more.

This fixed-seed Asian-basket workload grows the number of spot and volatility inputs. Ratios use a NumPy price baseline, while adjoints use a different implemented computation. At inputs, measured AAD work takes price-baseline times and bumps take . A ratio below one can reflect implementation, temporary arrays and shared-machine timing; it does not mean a gradient has negative or free work. The full logarithmic range is retained. Dashed curves are element-count proxies: forward output elements and backward input elements along edges. They are not hardware instructions or literal floating-point operation counts. They illustrate tape scaling separately from timing. Reverse differentiation also stores intermediate values. Checkpointing trades recomputation for memory. Accuracy still concerns the differentiated discrete program and its regularity assumptions. Next, finite differences.

12Finite differences I: theta schemes and stabilityMaster's3 min

A finite-difference method evolves the pricing equation on a stock-and-time grid. Start at the call payoff and move through time to expiry. Height here is explicitly signed logarithmic value, retaining the full stock domain and all saved slice values. It is a display transform, not a price rescaling. With two thousand time steps the recorded explicit solution stays smooth on this grid. With two hundred, the high-stock region becomes unstable. The signed-log scale exposes the growing oscillations instead of clipping them. The saved spot price is . The displayed diffusion number is sigma squared S-max squared delta-time over delta-S squared, whose diffusion threshold is one, not one half. Drift, reaction and boundary conditions require additional stability or monotonicity checks.

The Black–Scholes operator contains diffusion, drift and discounting. Central space differences have second-order consistency for a sufficiently smooth solution. The theta scheme is explicit at zero, implicit at one, and Crank–Nicolson at one half. Its familiar global time orders require regularity and stability. For constant-coefficient heat diffusion, Fourier analysis uses lambda equal to diffusion coefficient times time step over space step squared. Explicit stability requires lambda at most one half. Implicit and Crank–Nicolson factors stay between minus one and one; Crank–Nicolson can be negative. Lax equivalence connects stability and convergence for consistent approximations to a well-posed linear initial-value problem. In Black–Scholes the diffusion coefficient is one half sigma squared S squared. This gives the displayed diffusion-only estimate of steps. It does not alone certify the complete drift, reaction and boundary discretization.

The vertical axis is a signed logarithm, with ticks labelled by the actual growth factor. Both curves receive the same transform. The shaded band still means absolute growth no greater than one. At heat-equation lambda one half, the highest-frequency explicit factor reaches minus one. Beyond that it flips and grows; by lambda twenty its factor is minus seventy-nine, fully shown. Crank–Nicolson remains between minus one and one for nonnegative lambda, but its highest frequencies approach minus one and decay slowly. This is diffusion-mode analysis, with the complete pricing discretization requiring its own boundary and operator checks.

And measured. Each stable scheme's error as the grid is refined in price and time together. The fully implicit scheme is only first order in time. Crank–Nicolson is second order: on the finest grids, doubling the grid cuts its error times. Pause and predict: double the price points of a stable explicit grid. The bound has the price step squared in it, so you need four times the time steps, and eight times the work. Next: what goes wrong at the kink, and how a grid prices an American put.

13Finite differences II: ringing, and the American putMaster's3 min

Finite differences, part two: Crank–Nicolson's ringing, and the American put as a complementarity problem.

This is a pure alternating Fourier mode, not a windowed spike. With lambda twenty, the Crank–Nicolson factor is : it changes sign and decays slowly. A nonsmooth payoff excites high frequencies. On the full saved stock and gamma ranges, the digital's second derivative shows oscillations. These extreme gamma values are retained, rather than clipped to the analytical curve's percentiles. A fully implicit step of this full length has factor . The actual Rannacher start uses two half steps, whose combined factor is one over one plus twice lambda, squared, for this mode. It is a different factor and strongly damps high frequencies. Recovering second-order accuracy depends on the problem's regularity, start treatment and quantity being measured.

Now early exercise on a grid. Here is the American put's value over spot and time to expiry, from the House's solver. On the left the surface lies flat on the payoff: in the red region it is optimal to exercise, and the value is exactly the strike minus the spot. Its edge is the free boundary, in gold: at expiry it sits at the strike, and with a year to go it has retreated to about . Beneath, in grey, the European put, which cannot be exercised early. The gap between the two surfaces is the early-exercise premium of Part ten, largest deep in the money.

In symbols: the value is at least the payoff, the pricing equation holds as an inequality, and at every point one of the two is an equality: hold, or stop. On the grid, each time step becomes a linear complementarity problem; Michael Brennan and Eduardo Schwartz priced the American put this way in 1978. Projected over-relaxation, from Colin Cryer in 1971, sweeps the grid, updating each point and clipping it up to the payoff. The penalty method of Peter Forsyth and Kenneth Vetzal adds a huge penalty wherever the solution dips below the payoff, and solves with Newton's method. Pause and predict: where is the pricing equation not satisfied? In the red region of the surface we just saw, where the value is the payoff.

The curve is the update-size diagnostic for one PSOR time step, not a complementarity residual or a true-price error. It falls by an average factor of per sweep across sweeps. A tiny update alone does not certify a solution to roundoff. The saved PSOR grid gives . The finer penalty grid gives , using an average active-set iterations per time step. The separate finite tree gives . Finite penalty, grid and time errors remain. These implementations and different grid sizes take a time ratio of ; this is a case-specific computational comparison, not a convergence theorem or matched-accuracy speed claim.

The House's PSOR is eleven lines: the Crank–Nicolson update for one point, relaxed, and the single word max that makes it American. On a three-hundred-point grid it prices the put at , against from the tree. Next: grids in two dimensions, for Heston.

14ADI for HestonPhD2 min

ADI for Heston: two dimensions, one direction at a time. Heston adds variance as a state variable. The nonuniform grid crowds stock nodes around the strike and variance nodes near zero, where boundary behaviour can require resolution. A directional correction solves a tridiagonal system along each stock row. Another solves along each variance column. The tilted surface shows the computed solution's shape. Height is separately rescaled from zero to one for each surface; the displayed actual minimum and maximum preserve its units and range. These heights must not be compared as if they shared price units. Finite differences on the computed surface estimate delta, gamma and the variance-state derivative. The last is partial u over partial v, not the usual volatility vega. These extra differences are cheap, but their accuracy still depends on the numerical solution and grid.

The scheme. Heston's pricing equation has second derivatives in price and in variance, and a mixed derivative from their correlation. Split its operator into three: the mixed part, the price direction and the variance direction. Douglas's scheme takes an explicit step with everything, then corrects implicitly in one direction at a time. Each correction is a stack of tridiagonal systems, linear in the number of grid points. The mixed term stays explicit, which costs accuracy; Ian Craig and Andrew Sneyd's 1988 scheme corrects it with one more explicit stage and a second pair of sweeps. Karel in 't Hout and Sean Foulon compared the variants on Heston in 2010. And the grid: uniform in a stretched coordinate, mapped through a hyperbolic sine, so the points crowd where the action is.

The reference is a numerical COS price, rather than an exact oracle. With forty by twenty nodes, the uniform-grid discrepancy is , while the stretched-grid discrepancy is . At one hundred and sixty stock nodes the ratio is . Domain, boundary, time, space and reference errors all enter this comparison. Both directional schemes improve over these saved grids. Their ranking is case-dependent; the best displayed discrepancy is in recorded seconds. It is not a general accuracy or timing guarantee. When Feller's condition fails, zero variance is attainable, and near-zero behaviour can make variance-grid resolution important. This does not imply positive time spent exactly at zero or that curvature is always maximal there. Next, characteristic-function pricing.

15Fourier I: Carr-Madan and LewisMaster's3 min

Fourier pricing, part one: damping, transform inversion, and contour integration. Use one convention throughout: k is log strike divided by initial stock, c is call price divided by initial stock, and phi is the characteristic function of log return. A call as a function of k does not decay toward minus infinity. Carr–Madan multiplies by exponential alpha k, with positive alpha and a finite moment of order alpha plus one. These conditions make the damped transform integrable in the required domain; an arbitrary alpha is not admissible. The right plot uses the exact coordinate change of the saved absolute-log-strike transform to this normalized convention. Real and imaginary parts share one maximum-modulus scale. Both plots retain their complete saved ranges.

The derivation. Write the damped call's transform and swap the order of integration: the strike integral can be done in closed form, leaving the characteristic function evaluated at a shifted complex point, over a quadratic. Invert, and since the price is real, half the frequency line suffices. To use one fast Fourier transform for a whole grid of strikes, put frequencies at multiples of eta and log-strikes at multiples of lambda; the transform's kernel forces their product to be two pi over N. And alpha cannot be anything: the damped call needs the moment of order alpha plus one, which Heston loses at long maturities.

The two spacings are coupled by lambda times eta equals two pi over N. The rulers show the actual ticks in a finite visible window. At fixed N, reducing eta spreads strike nodes apart and also lowers the maximum frequency N eta. Quadrature spacing, frequency truncation and aliasing interact; smaller eta is not automatically more accurate. Doubling N with eta fixed halves strike spacing and extends the frequency range. For this saved Heston case the numerical-reference discrepancy changes from to across the displayed grids. This is a finite example rather than a universal FFT rate.

Lewis's contour method offers another inversion. The formula shown uses zero rates and zero dividends, relative log strike k, and the log-return characteristic function. The exponential has minus i u k with this convention. General carry requires the appropriate discount factors. The saved quadrature and COS values agree to displayed decimals. They share a characteristic function and numerical assumptions, so agreement is useful cross-checking, not an independent accuracy certificate. The alpha sweep levels near on this FFT grid. That is consistent with fixed-grid and interpolation error, but does not isolate their contribution or prove the only error source. Next, cosine expansions.

16Fourier II: the COS method, and the raceMaster's3 min

In grey is a high-term numerical Heston density reference, not an exact density. The cosine approximations retain all saved values, including negative oscillations. As terms are added, shape and tails improve. On these sampled density sites the sixty-four-term maximum discrepancy is ; at one hundred and twenty-eight it is , finite rather than gone. The coefficient plot shows all strictly positive saved magnitudes without an artificial floor; exact zeros have no finite logarithm and are omitted. Rapid decay is favourable in this example. Exponential convergence requires appropriate analyticity and coefficient decay and does not hold for every model.

Define x as log initial stock over strike, y as log terminal stock over strike, and phi as the characteristic function of y minus x. The payoff v of y is in currency units. Cut its density integral to a finite interval; a cumulant rule proposes the interval but does not certify payoff-tail error. A square-integrable density admits a cosine expansion in the L2 sense, with additional conditions for stronger convergence. The prime halves the constant term. Extending coefficient integrals to the full line introduces a tail approximation and gives the characteristic function with phase x minus a. Monetary payoff coefficients are elementary integrals, yielding the displayed pricing sum. Errors include tail and coefficient truncation, finite series and roundoff. Exponential series decay needs suitable analyticity, boundary behaviour and coefficient bounds. Conditional error-control results require their full assumptions.

Vary the interval half-width while retaining four thousand and ninety-six terms. The discrepancy from the same method at L forty is at L four, and at L sixteen. This comparison combines range and finite-series effects; it is not an exact truncation-error measurement. L forty has zero discrepancy by construction and is labelled separately, rather than plotted at a fake logarithmic zero. The code computes put coefficients, multiplies by characteristic-function phases, sums and uses put–call parity. The displayed -term reference discrepancy is . Shared assumptions and correlated numerical errors still limit what agreement establishes.

The same saved timings now include a stock control variate. The clock spans the recorded data range on a shared CPU. This is a comparison of different diagnostics, not a matched total-accuracy race. For COS, grids and FFT, the vertical metric is absolute difference from the chosen COS reference. The best displayed COS difference is . Sharing a reference limits independent validation. For Monte Carlo, height is one estimated sampling standard error, excluding fifty-step QE bias and any same-sample control-fitting bias. A fixed population control changes the asymptotic variance constant, with work and estimation effects considered separately. Here the empirical ratio is . Characteristic-function methods are useful for suitable vanillas; grids for manageable state dimensions; simulation for many high-dimensional and path-dependent problems. A terminal density alone cannot identify a barrier touch. COS backward-recursion extensions can nevertheless handle barriers and Bermudans. Next, industry workloads and hardware.

17Industry: the overnight run, GPUs and adjointsIndustry3 min

Banks use large pricing workloads for exposure, limits, margin and capital, with schedules and approximations varying by firm and purpose. The grid is an illustration of trades crossed with scenarios, not a measured bank production run. ISDA SIMM uses sensitivities for covered non-cleared initial margin. Its published methodology version does not imply every firm's current implementation. Basel's market-risk standardized approach includes a sensitivities-based component as well as default and residual-risk charges. These workloads help explain demand for efficient gradients, while operational and regulatory scope must be checked for the actual institution.

Two firm files, from the public record. Danske Bank won Risk.net's in-house system award for 2015 for building adjoint differentiation through its pricing and risk systems: as reported, counterparty adjustments and their sensitivities in seconds on ordinary hardware. Antoine Savine, who worked there, wrote the textbook on it. JPMorgan went the hardware way. With the firm Maxeler it moved the core of its credit-derivatives risk run onto programmable chips; the bank's and vendor's own account says a run of about eight hours fell to under four minutes, and the bank took a stake in the company. Graphics chips are measured by STAC-A2, a benchmark designed by bank quants: Monte Carlo Greeks of a multi-asset Heston option with early exercise, which is chapters two to eleven in a single test. In the open, QuantLib ships Sobol paths with a Brownian bridge and ORE builds valuation adjustments on it; the Options Clearing Corporation sets margins by Monte Carlo.

These timings use distinct workloads and repetition counts. The Python loop times one hundred thousand pre-generated payoffs, then extrapolates tenfold to seconds. NumPy directly prices one million pre-generated values in milliseconds. The ratio illustrates these implementations, with extrapolation and shared-machine effects. Float32 throughput does not certify price or Greek accuracy. Pool workers both draw normals and price them, so compare four workers with the one-worker pool: ratio . Startup, communication, workload and CPU quota all matter; host load alone cannot explain the result. The recorded host reports logical CPUs, while the container quota is four CPU equivalents. The separate COS timing and numerical-reference difference are shown without claiming matched total accuracy to Monte Carlo. LSM path simulation can be parallelized, but each exercise date requires regression reductions and synchronization.

Ten selected engine tests passed in this review. They check fixed examples at their actual tolerances: stochastic comparisons with sampling allowances, covariance identities, multilevel diagnostics, stopping examples, adjoint-bump agreement, grid and transform comparisons, and toy interpolation and amplitude cases. These are the repository's tests, not evidence of an automated nightly bank process or independent validation of every engine function. A passing suite supports these numerical cases. It does not certify every price, all discretization biases, out-of-sample calibration behaviour or the financial model itself. Model misspecification and computational error are distinct concerns. Next, quantum resource estimates.

18Quantum amplitude estimationPhD3 min

Amplitude estimation concerns oracle queries, before charging for building the oracle. Imagine a coherently prepared path distribution and a bounded payoff scaled into zero to one. An unbounded call requires truncation or another justified encoding, with its own error. The good-state probability a equals sine squared theta; one measurement is a Bernoulli observation. Our numerical demonstration uses a toy mean, not an encoded financial path distribution. The ideal Grover operator combines two reflections, rotating this two-dimensional subspace by twice theta. Its construction requires coherent state preparation and its inverse. Measurements at several powers can sharpen an angle estimate, while aliases, failure probability and oracle cost remain essential. The geometry describes an ideal operation rather than a circuit we have run.

For a normalized payoff between zero and one, the preparation operator puts square root a on the good subspace. The ideal Grover iterate uses that preparation, its inverse and reflections. After m iterates the good probability is sine squared of two m plus one times theta. Standard amplitude-estimation guarantees can achieve additive error of order one over query count at fixed success probability, compared with Monte Carlo's inverse-square-root sampling scale. Confidence amplification adds factors. Specific maximum-likelihood schedules also need alias and failure analysis. Neither this oracle statement nor Montanaro's broader algorithms establish an end-to-end speedup for an arbitrary derivative-pricing program.

The toy amplitude is . We simulate only ideal binomial measurement counts, not quantum circuits, state preparation or financial paths. Each likelihood curve is divided by its maximum, so it is neither a normalized probability density nor a posterior. Fifty shots at each scheduled Grover power multiply oscillating likelihood factors. Resolving aliases depends on the schedule and finite-grid maximum-likelihood procedure. Forty independent repetitions give empirical RMSE, fitted slope . The band is the tenth-to-ninetieth percentile of absolute errors, not a confidence interval. The comparator is the analytical Bernoulli Monte Carlo RMSE at the same summed oracle-query budget. At queries the ratio is . This is an ideal statistical experiment, with no wall-clock or gate-level advantage measured.

Two primary papers estimate resources under different stated constructions. In the twenty-twenty-one autocallable case, three assets and twenty time steps at target error two thousandths require roughly eight thousand logical qubits. The T-count is twelve billion and sequential T-depth fifty-four million. Counts and depths are different. This is not a demonstrated runtime, and the paper's TARF case has different resources. In twenty-twenty-four, the quantum-signal-processing construction reports about four thousand seven hundred logical qubits, total T-count two point four billion and T-depth forty-five million. Its amplitude-estimation tolerance is one thousandth at stated confidence point six eight. Matching an assumed classical second requires forty-five million sequential T-layers per second, not that many total gates per second. The sixteen-fold count and four-fold qubit improvements compare that paper's arithmetic reference, not the earlier eight-thousand-qubit headline. Error correction, physical qubits and state-preparation costs remain part of implementation. In a toy cost model, classical work proportional to one over error squared competes with quantum query work proportional to R over error. With equal normalized constants, crossover is near classical sample count R squared. If R is ten thousand, that is about one hundred million. Actual constants, payoff scale, confidence and an accuracy-dependent oracle cost can change the result.

19Frontier: interpolation and selected researchPhD3 min

Build a Chebyshev interpolant over this fixed two-parameter box: initial spot and initial variance, with the remaining contract and model parameters fixed. Labels come from a five-hundred-and-twelve-term COS calculation, so they have numerical error too. The surface compares on a separate twenty-five-by-twenty-five grid; saved log discrepancies below one trillionth are censored at that level. Four, eight, sixteen and thirty-two nodes per direction improve this example. The headline maximum is over two hundred fixed random test sites, not the supremum over the entire box. At thirty-two nodes per direction that sampled maximum is . Analytic interpolation theory requires regularity in a complex neighbourhood and appropriate bounds. Finite tests provide no extrapolation, Greek-accuracy or arbitrage certificate.

The final interpolant uses COS labels and has recorded build time seconds. A fixed query takes milliseconds, versus for the timed COS implementation. This is a shared-CPU, single-query comparison; batching and parameters can change it. The MC row reports one sampling standard error and is not accuracy-matched to these deterministic diagnostics. Break-even against repeated COS queries is build time divided by COS-query time minus interpolation-query time, provided that difference is positive. Here that is about queries. Building the interpolant consumes work; it does not disappear. Low-rank tensor methods exploit additional structure to address some higher-dimensional parameter spaces. They do not remove every dimensionality or accuracy problem.

This example compares the mean and median of eleven independently scrambled Sobol estimates of the exponential integral. RMSE uses thirty experiments. The full saved values are plotted. At the displayed thousand-point scale, the empirical RMSE ratio is . Pan and Owen's one-dimensional theorem assumes analytic derivative bounds and a repetition count growing with log sample size. Eleven fixed repeats do not meet that asymptotic condition, and this plot is not proof of a universal rate. The mean has no universal minus-three-halves ceiling for every integrand. Our SciPy construction uses a thirty-bit grid. Its uniform-grid leading bias for this integral is about minus eight times ten to minus ten, consistent with the median plateau. That plateau is far above double-precision machine epsilon.

Selected reading, with assumptions and versions attached. Pan and Owen give analytic-integrand and repetition-growth conditions for median estimators. Junike's COS error control requires its density regularity, tail and derivative bounds; it does not turn any cumulant rule into an unconditional guarantee. Bayer, Pelizzari and Schoenmakers's signature-based primal and dual stopping paper was revised in twenty-twenty-five. It develops non-Markovian approximation and convergence under its stated assumptions. The twenty-twenty-four quantum signal-processing paper is a particular resource analysis, without a claim here that it remains globally cheapest. Dalzell and colleagues' end-to-end survey has a twenty-twenty-five revision and Cambridge book edition. Chebyshev and tensor methods illustrate how offline work may support faster later queries when smoothness and low-rank structure are available.

For the researcher: paths against basis functionsPhD4 min

For the researcher: Chapter 8 regressed continuation values on a few polynomials. A richer basis approximates the true continuation value better, so why not use thirty? Because each extra function costs paths, and the cost grows faster than you would guess. Here is why, and how much it matters for the price.

At a regression date, least squares uses a sample Gram matrix and cross-moments; a pseudoinverse handles possible rank deficiency. For independent identically distributed states with finite fourth moments, a Gram diagonal is a sample average of squared basis values. Its variance is the displayed fourth-moment expression. If a basis function has unit second moment, its diagonal standard deviation is the square root of fourth moment minus one divided by path count. This is one RMS diagnostic, not a necessary and sufficient path budget. Full regression also depends on dimension, off-diagonal errors, target cross-moments and the smallest Gram eigenvalues. Glasserman and Yu analyse particular worst-case polynomial settings, obtaining exponential path growth for Brownian motion and faster growth for geometric Brownian motion. Their result does not prescribe the required paths for every option or basis.

These curves concern unconditional normalized basis moments, not the actual in-the-money design distribution at every exercise date. Gaussian Hermite fourth moments grow roughly as nine to the degree, with polynomial factors. Values here are floating-point quadrature results; polynomial quadrature identities in exact arithmetic do not make every stored number exact. Normalized lognormal monomials have fourth-moment ratio exponential in degree squared, as shown. A large degree-twelve moment warns about this particular diagonal statistic. It does not imply that a degree-twelve put requires ten billion paths, nor supply a price-error guarantee.

Here each fitted policy is evaluated on the same one hundred thousand paths, independent of fitting but repeatedly reused across training sizes, degrees and seeds. Its expectation is a lower bound; the finite estimate has Monte Carlo noise. Bars show three-seed minima and maxima, not confidence intervals. With five hundred training paths the displayed degree-four mean is ; degree twelve is lower by . This is a finite observed comparison, not proof that four is optimal. The two-thousand-path curves also show sensitivity to basis richness. With more training paths several degrees move closer to the three-thousand-step tree reference. That tree is itself approximate, and one policy's evaluation standard error is not a universal noise level. Observed shortfalls mix policy quality, evaluation noise and reference error; they cannot all be attributed to the rule.

Use discounted rewards Z and the optimal Snell continuation C on a finite exercise grid. Assume a fixed fitted continuation is uniformly within delta at every date. This is a strong hypothesis, not something the preceding finite experiment certifies. The performance-loss identity weights errors by which states the policy actually visits; a naive equality summing all wrong decisions at all dates is incorrect. Dropping occupancy gives the displayed upper bound. A wrong decision can occur only where the positive exercise gap is at most delta. Zero-gap decisions incur no loss. If each date satisfies a margin bound with exponent alpha, price loss is at most the sum of margin constants times delta to one plus alpha. Alpha one gives a quadratic bound. The constants have units and depend on the problem and horizon, so a two-percent continuation error does not automatically imply a four-hundredths-percent price loss.

Three follow-up directions for this demonstration. Compare basis designs in high dimension with fixed training, tuning and independent evaluation budgets. Separate approximation, estimation and optimization effects rather than asserting that one family always scales better. Allocate dual-estimator work across outer paths, inner simulations and martingale approximation, reporting each uncertainty source. For Greeks of fitted stopping rules, study boundary effects and the assumptions behind smoothing, score and differentiation methods. These are useful extensions of the demonstration, not claims that the literature has no rates or consistent estimators.

Pause and predict. Under the same linear-margin assumptions, constants and horizon, halve the uniform continuation error delta. What happens to the quadratic upper bound on policy price loss? Distinguish the bound from the realised loss.

The pricing engine, recap, desk questions, problemsAll tracks3 min

The House has a collection of pricing methods, rather than a universal accuracy certificate. Rule sixteen is to separate sampling uncertainty from discretization, truncation, reference and model errors, and choose verification suited to the method. No automated nightly production control is claimed here. These synthetic numerical examples add no market strategy trials; the part's cumulative counter remains .

Part sixteen in eleven lines. Sampling intervals have assumptions and measured coverage. Controls, shifts and randomized nets can reduce variance in suitable problems. Multilevel allocates correction work under bias and variance conditions. Fixed-policy and dual expectations bound finite-date stopping values, while their numerical estimates remain noisy. Adjoint work scales with a scalar-output tape, with memory and regularity costs. Grids require stability, appropriate boundaries and a careful start. Characteristic-function methods can be fast for suitable products. Every numerical ratio on this page belongs to its saved experiment, rather than a universal method ranking.

Four desk questions. For an unbiased iid estimator under a normal approximation, a target sampling half-width uses variance times one point nine six squared divided by target squared. One cent is one basis point only on a one-hundred-dollar notional; the units must be specified. Bias remains separate. Reverse work is proportional to a scalar-output tape, with memory and implementation costs. Crank–Nicolson can weakly damp high frequencies; a suitable implicit start can improve behaviour. A wide observed dual gap mixes policy quality, dual approximation, inner bias and outer uncertainty. Increasing inner work is a diagnostic, not proof that all remaining gap is policy loss. Worked solutions are in the notes.

Ten problems cover fixed-coefficient control variates, normal-shift importance sampling, finite-grid optional stopping, heat-equation stability, reverse-tape work, a hybrid gamma estimator, conditional multilevel complexity and the FFT grid constraint. The last two derive a single Gram-diagonal moment diagnostic and a one-date margin-conditioned price-loss bound. State the assumptions as part of each solution. Worked English and Chinese solutions are in the notes.

Where this comes back. Part seventeen trains networks on this engine's prices and adjoint Greeks. Rates models in Part nineteen are priced on lattices and by simulation. Part twenty-one runs the whole book under thousands of scenarios, and Part forty uses importance sampling for tail risk.

The notes identify the textbooks, original research and dated industry resource reports. Numerical examples are synthetic fixed-seed CPU runs with varying configurations: the parallel example uses multiple processes and the Part seventeen stopping reference uses two training threads. Published industry and quantum resource figures are external source claims, not local measurements.

This part provides numerical methods and evidence for specific pricing problems, with explicit assumptions and unresolved error sources. Next is Part seventeen, deep pricing and hedging: learning price maps, studying high-dimensional equations and training hedging or stopping policies, with their own approximation and evaluation questions.

Where it goes next. Adjoint differentiation is backpropagation: Part 17 trains networks with it. The engine prices every later product of the series.

Key results

The part's results in one place, for revision.

Monte Carlo error\[\hat\mu_n\pm1.96\,\frac{\hat\sigma}{\sqrt n}\]
Control variate\[\hat\mu_{cv}=\bar Y-b^\ast(\bar C-\mathbb E C),\qquad b^\ast=\frac{\operatorname{Cov}(Y,C)}{\operatorname{Var}C}\]
Multilevel cost\[\text{cost}(\varepsilon)=O\bigl(\varepsilon^{-2}(\log\varepsilon)^2\bigr)\ \text{against}\ O(\varepsilon^{-3})\]
Theta scheme\[\frac{V^{n+1}-V^{n}}{\Delta t}=\theta\,\mathcal L V^{n+1}+(1-\theta)\,\mathcal L V^{n}\]

Try it

Lab 16 · Monte Carlo, variance reduction and Sobol: the race

Price one European call with plain Monte Carlo, antithetic pairs, a control variate, importance sampling and scrambled Sobol points. Measure each estimator's error across seeds and its rate of convergence.

Figure produced by Lab 16: Monte Carlo, variance reduction and Sobol: the race
Produced by the lab below, seed 0, in 0.4 s. Simulated data.
python -m videos.quant.labs 16 needs numpy, scipy, matplotlib, numba · download lab16.py · source on GitHub
Black-Scholes price          5.2934
plain Monte Carlo            RMSE at n = 32,768: 0.06358   rate n^-0.52   variance cut x1
antithetic pairs             RMSE at n = 32,768: 0.05100   rate n^-0.51   variance cut x2
control variate (the stock)  RMSE at n = 32,768: 0.03673   rate n^-0.47   variance cut x3
importance sampling          RMSE at n = 32,768: 0.04336   rate n^-0.52   variance cut x2
scrambled Sobol              RMSE at n = 32,768: 0.00035   rate n^-0.99   variance cut x33,283

Variance reduction changes the constant; only low-discrepancy points change the rate.
The code (65 lines; it asserts its own result)
"""Lab 16: the same price from five estimators, and how fast each one converges."""

import numpy as np

from videos.quant import labs
from explainer.quant.house import bs, engine

TITLE = "Monte Carlo, variance reduction and Sobol: the race"
GOAL = ("Price one European call with plain Monte Carlo, antithetic pairs, a control variate, importance sampling "
        "and scrambled Sobol points. Measure each estimator's error across seeds and its rate of convergence.")
TASKS = [
    "Move the strike to 140. Which method gains most, and which loses its advantage?",
    "Price an Asian call with engine.asian_control: how correlated is the geometric control?",
    "Run engine.mlmc(0.01) and compare its cost with a single-level Euler run at the same accuracy.",
]


def sobol_call(S0, K, T, sigma, r, n, seed):
    z = engine.normals(n, 1, "sobol", seed)[:, 0]
    ST = S0 * np.exp((r - 0.5 * sigma ** 2) * T + sigma * np.sqrt(T) * z)
    return float(np.exp(-r * T) * np.maximum(ST - K, 0).mean())


def run(seed=0):
    S0, K, T, sigma, r = 100.0, 110.0, 1.0, 0.2, 0.03
    exact = float(bs.price(S0, K, T, sigma, r))
    ns = 2 ** np.arange(8, 16)
    methods = ["plain", "antithetic", "control", "is", "sobol"]
    rmse = {m: [] for m in methods}
    for n in ns:
        for m in methods:
            if m == "sobol":
                est = [sobol_call(S0, K, T, sigma, r, n, seed + s) for s in range(40)]
            else:
                est = [engine.mc_call(S0, K, T, sigma, r, int(n), m, seed + s)[0] for s in range(40)]
            rmse[m].append(np.sqrt(np.mean((np.array(est) - exact) ** 2)))
    slope = {m: np.polyfit(np.log(ns), np.log(rmse[m]), 1)[0] for m in methods}
    lab = labs.Lab()
    lab.row("Black-Scholes price", f"{exact:.4f}")
    names = {"plain": "plain Monte Carlo", "antithetic": "antithetic pairs", "control": "control variate (the stock)",
             "is": "importance sampling", "sobol": "scrambled Sobol"}
    for m in methods:
        lab.row(names[m], f"RMSE at n = 32,768: {rmse[m][-1]:.5f}   rate n^{slope[m]:+.2f}   "
                          f"variance cut x{(rmse['plain'][-1] / rmse[m][-1]) ** 2:,.0f}")
    lab.note = "Variance reduction changes the constant; only low-discrepancy points change the rate."
    assert all(abs(slope[m] + 0.5) < 0.12 for m in methods[:4]) and slope["sobol"] < -0.8
    assert max(rmse[m][-1] for m in ("antithetic", "control", "is")) < rmse["plain"][-1]
    assert rmse["sobol"][-1] < 0.2 * rmse["plain"][-1]

    colors = dict(zip(methods, (labs.CASH, labs.SPOT, labs.GAIN, labs.P, labs.OPTION)))
    fig, ax = labs.figure(2, size=(11, 4.2))
    for m in methods:
        ax[0].loglog(ns, rmse[m], "o-", color=colors[m], ms=3, label=f"{names[m]} ({slope[m]:+.2f})")
    ax[0].set(title="Error against the number of paths", xlabel="paths n", ylabel="RMSE over 40 seeds")
    ax[0].legend(fontsize=7.5)
    u = np.random.default_rng(seed).random((512, 2))
    from scipy.stats import qmc

    s = qmc.Sobol(2, scramble=True, seed=seed).random(512)
    ax[1].scatter(u[:, 0], u[:, 1] * 0.48, s=5, color=labs.CASH, label="pseudo-random")
    ax[1].scatter(s[:, 0], 0.52 + s[:, 1] * 0.48, s=5, color=labs.OPTION, label="Sobol")
    ax[1].set(title="512 points: random (below) and Sobol (above)", xticks=[], yticks=[])
    ax[1].grid(False)
    lab.fig = fig
    return lab

Now change it

  1. Move the strike to 140. Which method gains most, and which loses its advantage?
  2. Price an Asian call with engine.asian_control: how correlated is the geometric control?
  3. Run engine.mlmc(0.01) and compare its cost with a single-level Euler run at the same accuracy.

Problems, with solutions

Try each problem before opening its solution; the last two of each set are at qualifying-exam level.

Ten worked solutions — English

  1. A fixed control coefficient. For a deterministic coefficient and finite second moments, show that the control-variate estimator \(\bar Y - b(\bar C - \mathbb{E}C)\) has minimal variance at \(b^* = \text{cov}(Y, C)/\text{var}(C)\), and that the variance falls by the factor \(1 - \rho_{YC}^2\).

    Solution

    For iid pairs with finite second moments and Var(C)>0, Var(Ȳ−b(C̄−EC)) = [Var(Y)−2bCov(Y,C)+b²Var(C)]/n. Completing the square gives b*=Cov(Y,C)/Var(C), and minimum Var(Y)(1−ρ²)/n. This identity concerns a deterministic population coefficient. Same-sample fitting can bias the estimator; a frozen independent pilot preserves conditional unbiasedness.

  2. Normal-shift importance sampling. For importance sampling with a normal shifted by \(\theta\), derive the likelihood ratio, and the \(\theta\) that centres the shifted normal on the strike.

    Solution

    With p=N(0,1), qθ=N(θ,1), p(z)/qθ(z)=exp(−θz+θ²/2). Evaluate under qθ and weight every payoff. For zero dividend yield, log ST=log S₀+(r−σ²/2)T+σ√T z, so the strike threshold is zK=[log(K/S₀)−(r−σ²/2)T]/(σ√T). Setting θ=zK centres the proposal on the threshold. It need not minimize variance, and cross-entropy need not find that minimum either. Support and required moments must hold.

  3. Finite-grid dual upper expectation. On a finite exercise grid with integrable rewards and an integrable martingale, show that for \(M_0=0\), \(\sup_\tau \mathbb{E}[h_\tau] \le \mathbb{E}[\max_t (h_t - M_t)]\).

    Solution

    Let h be integrable discounted rewards on a finite horizon and M an admissible integrable martingale with M₀=0. Optional stopping gives EMτ=0 for every admissible stopping time. Thus Ehτ=E(hτ−Mτ)≤E maxᵢ(hᵢ−Mᵢ). Take the supremum over τ. The maximum must be integrable. A noisy nested process is not automatically a martingale; its expected-maximum argument uses the separate conditional-unbiasedness/Jensen construction. Finite Monte Carlo estimates are not sure bounds.

  4. Heat-equation stability. Derive the stability condition of the explicit scheme for the heat equation by von Neumann analysis.

    Solution

    For u_t=a u_xx, the explicit centred update has amplification g=1−4λsin²(ξ/2), λ=aΔt/Δx². For a≥0, |g|≤1 at all frequencies exactly when 0≤λ≤1/2, under the periodic/infinite-grid Fourier setup. In Black–Scholes, a=σ²S²/2, so its diffusion-only criterion is σ²Smax²Δt/ΔS²≤1. A full pricing scheme must also handle drift, reaction and boundaries.

  5. Reverse-tape work. For a scalar-output differentiable tape, show reverse work is \(O(\text{tape work})\); contrast computing all input directions by forward sweeps. State memory and elementary-operation assumptions.

    Solution

    For scalar output y and differentiable elementary operations, seed ȳ=1. Each edge i→j contributes v̄ⱼ ∂vⱼ/∂vᵢ to v̄ᵢ. Visiting each edge once costs O(W) for tape work W under the operation model, with storage or recomputation costs. Computing all n input directions by separate forward sweeps costs O(nW). The tape's own W can grow with n; there is no universal wall-clock factor, and many output components can require more reverse sweeps.

  6. Hybrid call gamma. Build a mixed estimator of a call's gamma: pathwise once (for delta), then the likelihood ratio.

    Solution

    In Black–Scholes with S₀,σ,T>0, let D=e^(−rT)(ST/S₀)1{ST>K}, the pathwise delta integrand. For the lognormal terminal density, the spot score is Z/(S₀σ√T). D also has explicit dependence 1/S₀ at fixed ST. Differentiating its expectation by the score method therefore gives Γ=E[e^(−rT)ST/S₀² ·1{ST>K}·(Z/(σ√T)−1)]. The −1 term is essential. Density differentiation and integrability conditions justify the identity. A sample average estimates gamma with its own sampling variance; a discontinuous integrand should not be differentiated naively pathwise again.

  7. MLMC when β=γ. Under Giles's bias, independence and allocation conditions, with \(\beta = \gamma\): show that \(\sum_l \sqrt{V_l C_l}\) grows like \(L \sim \log \varepsilon^{-1}\), so the cost is \(O(\varepsilon^{-2}(\log\varepsilon)^2)\).

    Solution

    Assume the theorem's positive bias, correction-variance and work exponents, independent level estimates, α≥min(β,γ)/2 and appropriate integer-allocation/regularity conditions. With bias O(M^(−αL)), L=O(log ε⁻¹). Each √(VₗCₗ)=O(1) when β=γ, so the sum is O(L+1). Optimal continuous allocation gives cost proportional to ε⁻²(Σ√(VₗCₗ))², hence O(ε⁻²(log ε)²), including the theorem's allocation treatment. This does not certify an adaptive bias proxy.

  8. FFT spacing. Show that the FFT forces \(\lambda\eta = 2\pi/N\) in Carr and Madan's discretisation.

    Solution

    Set uⱼ=jη and kₘ=−b+mλ. In exp(−iuⱼkₘ), exp(ijηb) is a pre-factor, while the j,m kernel is exp(−ijmηλ). Matching the N-point FFT kernel exp(−2πijm/N) requires ηλ=2π/N. At fixed η, doubling N halves strike spacing and extends frequency cutoff. At fixed N, changing η trades spacing, truncation and aliasing effects.

  9. Gram diagonal and lognormal moments. (qual) Show that \(\operatorname{Var}(\hat G_{kk}) = (\mathbb E\psi_k^4 - (\mathbb E\psi_k^2)^2)/N\), and that for \(\psi_k = S^k/\sqrt{\mathbb E S^{2k}}\) with \(S = e^{\sigma W_t - \sigma^2t/2}\), \(\mathbb E\psi_k^4 = e^{4\sigma^2tk^2}\).

    Solution

    For iid states and finite Eψₖ⁴, Ĝₖₖ=N⁻¹Σψₖ(Xₙ)² has variance [Eψₖ⁴−(Eψₖ²)²]/N. If Eψₖ²=1 its standard deviation is √[(Eψₖ⁴−1)/N]. For S=exp(σW_t−σ²t/2), ESᵖ=exp[(p²−p)σ²t/2]. Therefore, for ψₖ=Sᵏ/√ES²ᵏ, Eψₖ⁴=ES⁴ᵏ/(ES²ᵏ)²=exp(4σ²tk²). This single-diagonal diagnostic does not control the full inverse Gram matrix or price error, and the unconditional law differs from in-the-money regression sampling.

  10. One-date margin bound. (qual) For a one-date stopping problem (stop and get \(h\), or continue and get \(C\)), show that using \(\hat C\) loses \(\mathbb E[|C - h|\,\mathbf 1\{\text{wrong}\}] \le \mathbb E[|C - \hat C|\,\mathbf 1\{|C - h| \le |C - \hat C|\}]\), and that this is \(O(\varepsilon^2)\) if \(\Pr(0<|C - h| \le \varepsilon) = O(\varepsilon)\) and \(|C - \hat C| \le \varepsilon\).

    Solution

    Given true continuation C, payoff h and fitted continuation Ĉ, a wrong decision loses Δ=|C−h| and requires Δ≤|C−Ĉ|. If |C−Ĉ|≤ε uniformly, expected loss ≤E[Δ1{0<Δ≤ε}]≤εP(0<Δ≤ε). A margin bound P(0<Δ≤u)≤Auᵅ gives loss ≤Aε^(1+α). Zero-gap atoms incur no loss and need not be excluded from the state distribution. Linear margin α=1 gives a quadratic bound with units and constants. Halving ε quarters this bound, not necessarily the realised loss. In multiple dates, use the Snell continuation and the policy-occupancy identity; dropping occupancy gives a sum of per-date bounds, rather than a naive equality over every wrong decision.

Reading and notes

The part's papers

from READING.md

  • Crank, J., Nicolson, P. (1947). "A practical method for numerical evaluation of solutions of partial differential equations of the heat-conduction type." Proc. Cambridge Phil. Soc.
  • Boyle, P. (1977). "Options: a Monte Carlo approach." JFE.
  • Schwartz, E. (1977). "The valuation of warrants: implementing a new approach." JFE.
  • Brennan, M., Schwartz, E. (1978). "Finite difference methods and jump processes arising in the pricing of contingent claims." JFQA.
  • Rannacher, R. (1984). "Finite element solution of diffusion problems with irregular data." Numerische Mathematik.
  • Craig, I., Sneyd, A. (1988). "An alternating-direction implicit scheme for parabolic equations with mixed derivatives." Computers & Mathematics with Applications.
  • Paskov, S., Traub, J. (1995). "Faster valuation of financial derivatives." JPM.
  • Broadie, M., Glasserman, P. (1996). "Estimating security price derivatives using simulation." Management Science.
  • Caflisch, R., Morokoff, W., Owen, A. (1997). "Valuation of mortgage-backed securities using Brownian bridges to reduce effective dimension." J. Computational Finance.
  • Fournié, E., Lasry, J.-M., Lebuchoux, J., Lions, P.-L., Touzi, N. (1999). "Applications of Malliavin calculus to Monte Carlo methods in finance." Finance and Stochastics.
  • Carr, P., Madan, D. (1999). "Option valuation using the fast Fourier transform." J. Computational Finance.
  • Longstaff, F., Schwartz, E. (2001). "Valuing American options by simulation: a simple least-squares approach." RFS.
  • Tsitsiklis, J., Van Roy, B. (2001). "Regression methods for pricing complex American-style options." IEEE Trans. Neural Networks.
  • Lewis, A. (2001). "A simple option formula for general jump-diffusion and other exponential Lévy processes." Working paper.
  • Rogers, L. C. G. (2002). "Monte Carlo valuation of American options." Mathematical Finance.
  • Haugh, M., Kogan, L. (2004). "Pricing American options: a duality approach." Operations Research.
  • Andersen, L., Broadie, M. (2004). "Primal-dual simulation algorithm for pricing multidimensional American options." Management Science.
  • Giles, M., Glasserman, P. (2006). "Smoking adjoints: fast Monte Carlo Greeks." Risk.
  • Giles, M. (2008). "Multilevel Monte Carlo path simulation." Operations Research.
  • Fang, F., Oosterlee, C. (2008). "A novel pricing method for European options based on Fourier-cosine series expansions." SIAM J. Scientific Computing.
  • Joe, S., Kuo, F. (2008). "Constructing Sobol sequences with better two-dimensional projections." SIAM J. Scientific Computing.
  • in 't Hout, K., Foulon, S. (2010). "ADI finite difference schemes for option pricing in the Heston model with correlation." Int. J. Numerical Analysis and Modeling.
  • Capriotti, L. (2011). "Fast Greeks by algorithmic differentiation." J. Computational Finance.
  • Rebentrost, P., Gupt, B., Bromley, T. (2018). "Quantum computational finance: Monte Carlo pricing of financial derivatives." Physical Review A.
  • Stamatopoulos, N., et al. (2020). "Option pricing using quantum computers." Quantum.
  • Chakrabarti, S., et al. (2021). "A threshold for quantum advantage in derivative pricing." Quantum.
  • Metropolis, N., Ulam, S. (1949). "The Monte Carlo method." JASA.
  • Box, G. E. P., Muller, M. E. (1958). "A note on the generation of random normal deviates." Annals of Mathematical Statistics.
  • Sobol', I. M. (1967). "On the distribution of points in a cube and the approximate evaluation of integrals." USSR Comp. Math. and Math. Physics.
  • Cryer, C. W. (1971). "The solution of a quadratic programming problem using systematic overrelaxation." SIAM J. Control.
  • Kemna, A., Vorst, A. (1990). "A pricing method for options based on average asset values." J. Banking & Finance.
  • Rubinstein, R. (1997). "Optimization of computer simulation models with rare events." European J. Operational Research (the cross-entropy method).
  • Broadie, M., Glasserman, P. (1997). "Pricing American-style securities using simulation." J. Economic Dynamics and Control (random trees).
  • Glasserman, P., Heidelberger, P., Shahabuddin, P. (1999). "Asymptotically optimal importance sampling and stratification for pricing path-dependent options." Mathematical Finance.
  • Clément, E., Lamberton, D., Protter, P. (2002). "An analysis of a least squares regression method for American option pricing." Finance and Stochastics.
  • Forsyth, P., Vetzal, K. (2002). "Quadratic convergence for valuing American options using a penalty method." SIAM J. Scientific Computing.
  • Brassard, G., Høyer, P., Mosca, M., Tapp, A. (2002). "Quantum amplitude amplification and estimation." Contemporary Mathematics.
  • Broadie, M., Glasserman, P. (2004). "A stochastic mesh method for pricing high-dimensional American options." J. Computational Finance.
  • Griewank, A., Walther, A. (2008). Evaluating Derivatives, 2nd ed. SIAM.
  • Fang, F., Oosterlee, C. (2009). "Pricing early-exercise and discrete barrier options by Fourier-cosine series expansions." Numerische Mathematik.
  • Salmon, J., Moraes, M., Dror, R., Shaw, D. E. (2011). "Parallel random numbers: as easy as 1, 2, 3." SC'11 (Philox).
  • Weston, S., Spooner, J., Racanière, S., Mencer, O. (2012). "Rapid computation of value and risk for derivatives portfolios." Concurrency and Computation: Practice and Experience (JPMorgan and Maxeler's FPGA risk run).
  • Montanaro, A. (2015). "Quantum speedup of Monte Carlo methods." Proc. Royal Society A.
  • Rhee, C.-H., Glynn, P. (2015). "Unbiased estimation with square root convergence for SDE models." Operations Research.
  • Giles, M. (2015). "Multilevel Monte Carlo methods." Acta Numerica.
  • Gaß, M., Glau, K., Mahlstedt, M., Mair, M. (2018). "Chebyshev interpolation for parametric option pricing." Finance and Stochastics.
  • Becker, S., Cheridito, P., Jentzen, A. (2019). "Deep optimal stopping." JMLR (the max-call bounds [26.156, 26.162]; Part 17).
  • Glau, K., Kressner, D., Statti, F. (2020). "Low-rank tensor approximation for Chebyshev interpolation in parametric option pricing." SIAM J. Financial Mathematics.
  • Suzuki, Y., et al. (2020). "Amplitude estimation without phase estimation." Quantum Information Processing.
  • Owen, A. (2022). "On dropping the first Sobol' point." Monte Carlo and Quasi-Monte Carlo Methods 2020, Springer.
  • Junike, G., Pankrashkin, K. (2022). "Precise option pricing by the COS method—how to choose the truncation range." Applied Mathematics and Computation.
  • Frontier (2023–2026): Pan, Z., Owen, A. (2023). "Super-polynomial accuracy of one dimensional randomized nets using the median-of-means." Mathematics of Computation; Bayer, C., Pelizzari, L., Schoenmakers, J. (2023). "Primal and dual optimal stopping with signatures." arXiv 2312.03444; Dalzell, A., et al. (2023). "Quantum algorithms: a survey of applications and end-to-end complexities." arXiv 2310.03011; Junike, G. (2024). "On the number of terms in the COS method for European option pricing." Numerische Mathematik; Stamatopoulos, N., Zeng, W. (2024). "Derivative pricing using quantum signal processing." Quantum.

Papers and sources

Primary references and dated claims

Data, scope and reproducibilityScope and reproducibility

The existing compute driver and House numerical algorithms are unchanged in this polish. All 37 original Part 16 cache items were restored through their ordinary fixed-seed commands. The referenced Part 17 stopping result was also restored normally. No market data, new market-strategy trials, cache refreshes or sealed holdouts were used. Part 16's historical trial counter remains 312, and the series counter remains 23,562.

Examples include Black–Scholes calls and puts, discretely monitored Asian options, the Heston model with initial and long-run variance 0.04, mean reversion 1.5, volatility of variance 0.5 and correlation −0.7, and a five-asset Bermudan max-call. Different examples use different rates and dividends; the opening Heston comparison uses zero rates and zero dividends.

These are CPU experiments with varying configurations. In particular, the parallel workload uses process pools and the Part 17 stopping reference uses two training threads. Timings depend on implementation, repetition policy, workload, host and container quota. Published bank examples and quantum resource estimates are external claims with their own scope.

The completed source pass preserves full saved display ranges. Some panels intentionally select observations: the American path fan shows the first 150 saved paths, and each date's regression panel shows the first 300 saved in-the-money observations. The nested-path illustration selects a positive-payoff example from up to 40 candidates. Neither selection is a representative performance estimate. ADI surfaces are explicitly shown as separately rescaled shapes with actual ranges printed. The finite-difference instability plot uses a signed logarithmic vertical coordinate. The Chebyshev error surface retains the cache's declared censoring at 10⁻¹².

Data, scope and reproducibilitySelected restored results

These values identify the saved experiment. They are not promises for other products or machines.

Quantity Saved result and limit
Plain-call payoff standard deviation 14.7242; normal-approximation sampling half-width ±0.01 suggests 8.329 million iid paths. Bias is separate.
Empirical interval coverage 944 of 1,000 repetitions; this coverage estimate itself has sampling uncertainty.
Geometric Asian control Mean empirical variance ratio 1,299.7 across five seeds; stock control 2.836. Fitting and setup affect comparisons.
Normal-shift importance sampling Strike-centred shift ≈2.200; best tested grid shift 2.75, empirical ratio 133.0. Cross-entropy is a different optimization problem.
25-date policy evaluation 6.070952 ±0.011418, one estimated s.e., on 400,000 fresh paths. In-sample mean 6.060957 is not the lower expectation estimate.
Nested upper expectation estimate 6.414419 ±0.056730 with 50 inner paths; 6.075002 ±0.009047 with 1,600. Each uses 400 outer paths; nested bias is additional.
Same-date tree reference 6.066965 at 5,000 steps; finite tree error remains. Point estimates need not enclose it.
Five-asset policies LSM with 200,000 fitting paths: 26.103290 ±0.013914 on two million evaluation paths. Part 17 network: 26.108393 ±0.019744 on one million. Evaluation errors do not measure training uncertainty or prove equivalence.
AAD at 128 inputs 0.7035 NumPy-price-baseline times versus 259.67 for central bumps. Different implemented computations and timing effects explain why a measured ratio may be below one; a gradient is not free.
Parallel timing scope Loop: 100,000 timed then ×10; NumPy: one million pre-generated values; pool: draw plus price. Best-of counts are 2, 5 and 3 respectively. Recorded host count 5 logical CPUs; container quota 4 CPU equivalents.
Chebyshev 32×32 labels; sampled maximum 3.7051×10⁻⁶ at 200 sites. Build 0.316876 s, fixed query 0.108865 ms versus COS 0.286893 ms; break-even ≈1,780 queries if these timings persist.
RQMC median Fixed 11 repetitions, 30 experiments and 30-bit Sobol grids. Leading uniform-grid bias for ∫exp(u)du is approximately −8.0014×10⁻¹⁰.
Chapter notesChapters and qualifications
Scene Subject and interpretation
Opening Separate recorded timings; Monte Carlo height is one sampling standard error, while grid and Fourier heights are absolute differences from a COS reference. These are different metrics. The history retains all 13 events.
1. Monte Carlo Pointwise asymptotic intervals, finite-replicate coverage, centred Berry–Esseen moment, and variance times work. Coverage at many running sample sizes is not simultaneous coverage.
2. Paths Inverse normal, Box–Muller, covariance factors and a power-of-two Brownian bridge. Philox uses path-indexed keys [2026, j]; the reproducibility demonstration does not prove independent streams or cross-platform identity.
3. Controls and strata Fixed population coefficient versus a coefficient estimated from the same sample; antithetic comparisons at equal payoff evaluations; common histogram bins and denominators; empirical stratification and Latin-hypercube ratios. Moment matching can bias nonlinear estimates.
4. Importance sampling Support and moment conditions; full variance-ratio curve; a best tested shift on a finite grid rather than an exact optimum. Cross-entropy optimizes a divergence and uses the strike through the payoff. Freeze a learned proposal before independent production evaluation.
5. QMC Aligned dyadic elementary boxes, rather than arbitrary equal-area shapes. Koksma–Hlawka requires finite Hardy–Krause variation. Measured L2-star discrepancy differs from its supremum counterpart. Ten-scramble normal intervals are approximate. Finite-bit scrambling can produce zero; the normal transform clamps endpoints at 10⁻¹².
6. Bridge and PCA Different factors preserve the joint Gaussian law, rather than individual paths. Reported coordinate shares concern a linear Brownian average. PCA maximizes discrete path energy, not variance capture for every payoff. Replicate standard deviation excludes bias.
7. MLMC Telescoping, independent-level MSE decomposition, variance/work allocation and the full conditional complexity theorem. Last-correction bias is an adaptive proxy. The standard comparison estimates step work, rather than measuring matched total RMSE or seconds.
8. LSM Simulated paths and 25 exercise dates: a Bermudan contract. A fixed policy's expectation is a lower bound; a noisy evaluation and an in-sample mean need not be. Polynomial sweeps reuse evaluation paths; seed bands are minima and maxima.
9. Duality Finite-grid optional stopping; ideal Doob martingale versus noisy nested approximation; conditional Jensen comparison. Both reported point estimates have Monte Carlo error. The fresh policy evaluation replaces the in-sample lower label.
10. Greeks Thirty-seed RMSE, smoothness conditions for central bumps, regularity for common numbers, and differentiation-under-expectation conditions. A digital's derivative is undefined at its strike; the Dirac derivative is distributional. Score identities need regular density/support and direct terms when the payoff explicitly depends on the parameter.
11. AAD A scalar-output gradient in work proportional to the executed tape, with memory costs. One-path derivatives require pathwise conditions before becoming expectation Greeks. The derivative with respect to maturity is not calendar theta. Element-count proxies are not literal FLOPs.
12. Finite differences The diffusion-only number σ²Smax²Δt/ΔS² has threshold one; the heat-equation number aΔt/Δx² has threshold one half. Drift, reaction and boundaries need further checks. Signed-log plots retain the unstable high-stock region.
13. LCP Pure alternating mode and weak CN damping; two implicit half steps have a different factor from one full step. Full gamma ranges, conditional PSOR convergence, finite penalty error and update size versus residual.
14. ADI Directional tridiagonal solves, mixed terms and conditional time order. Separately normalized price and derivative shapes show actual ranges. The variance-state partial derivative is not standard volatility vega. COS is a numerical reference.
15. Fourier Relative log strike k=log(K/S₀), normalized call c=C/S₀ and a log-return characteristic function. Half-line inversion takes a real part. The Lewis formula shown assumes zero rates/dividends and uses exp(−iuk). Saved absolute-log-strike transform arrays are changed exactly to these coordinates.
16. COS A high-term numerical density reference, finite density errors, L2 expansion conditions, tail/coefficient/series/roundoff errors and conditional exponential convergence. At L=40 the discrepancy is zero by construction against the same reference. COS recursion extensions can handle some barriers and Bermudans.
17. Industry Dated primary accounts, scoped SIMM/FRTB statements, distinct timing workloads, and actual selected test tolerances. No invented nightly automation or model-validation certificate.
18. Quantum Ideal binomial measurements for toy amplitude 0.3; no financial circuit was built. Oracle-query counts differ from runtime. Likelihood curves are maximum-normalized; percentile bands are not confidence intervals. Separate logical qubits, T-count, T-depth and assumed T-layer clocks.
19. Research selection Chebyshev maximum over 200 fixed test sites, not a box supremum. Build-time break-even includes the actual build. The RQMC plateau is consistent with a 30-bit grid bias, not double precision. Theorems require their analytic and repetition-growth conditions.
Research A single Gram-diagonal RMS diagnostic is not a universal regression path budget. Unconditional moments differ from the in-the-money design. Exercise-loss bounds need policy occupancy, uniform continuation error and a margin condition. A worked halving-error answer follows the pause.
Closing Consistent recap, four desk questions and ten exercises with the assumptions below.

中文讲义

本讲的中文说明、交易台问题与习题解答(与英文版对应)。

Problems, with worked solutions中文说明与十题解答

本部分在合成教材合约上研究数值定价、敏感度和行权策略,区分抽样不确定性、离散与截断偏差、数值参考误差和模型假设。标准误或两个实现相符,都不能认证总精度。二十二个场景包含开场、十九章、研究章和结尾。当前英文旁白估计约六十六分钟,成片还包含动画和停顿。

本轮没有修改计算驱动或定价引擎算法。三十七项原始缓存及第十七部分停止参考按原有固定种子正常恢复,没有刷新缓存、读取密封保留集或新增市场策略试验。本部分累计计数为312,全系列为23,562。处理器配置因实验而异,并行案例使用多个进程,停止参考使用两个训练线程。

图中保留保存数据的完整显示范围。部分图明确抽取子集:行权图显示前150条路径,各日期回归显示前300个保存价内观察值;嵌套路径特意选取有正支付的例子。它们不代表性能抽样。二维方向分裂曲面分别缩放形状,并显示实际数值范围;不稳定差分图采用带符号对数;插值曲面的原缓存明确在10⁻¹²处截尾。

研究章的四阶矩公式只诊断单个格拉姆对角项,不是通用路径预算。价内设计分布、矩阵维度、非对角误差和条件数都重要。继续价值的一致误差与边界概率条件可给出行权损失上界,但不能把百分之二误差直接变成百分之零点零四价格损失。研究暂停题随后给出“误差减半,上界缩为四分之一”的条件解答。

  1. 固定控制系数。 对独立同分布样本对且二阶矩有限,控制估计方差等于[Var(Y)−2bCov(Y,C)+b²Var(C)]/n。控制方差为正时,配方得到b*=Cov(Y,C)/Var(C),最小方差为Var(Y)(1−ρ²)/n。它针对固定总体系数。同样本估计系数可能有偏;独立试验拟合后固定系数,可保持条件无偏。

  2. 正态平移。 原密度为标准正态,提议密度均值为θ时,似然比为exp(−θz+θ²/2)。在提议分布下抽样并加权。零股息下,支付开始的正态阈值为[log(K/S₀)−(r−σ²/2)T]/(σ√T)。把θ设为该阈值,使提议中心对准支付区域,但未必方差最优。交叉熵最小化另一种目标,也未必找到方差最优值;还需支撑和可积条件。

  3. 有限网格对偶。 支付已折现,期限有限,鞅可积且初值为零。可选停止给出EMτ=0,所以Ehτ=E(hτ−Mτ)≤E maxᵢ(hᵢ−Mᵢ),再对策略取上确界。最大值也须可积。含噪嵌套过程不自动为鞅;相应上界期望依赖另外的条件无偏和詹森论证。有限蒙特卡洛点估计不是必然上界。

  4. 热方程稳定性。 显式中心格式增长因子为1−4λsin²(ξ/2),λ=aΔt/Δx²。在周期或无限网格傅里叶分析下,非负扩散系数的全频稳定条件是λ≤1/2。布莱克斯科尔斯扩散系数为σ²S²/2,因此纯扩散条件为σ²Smax²Δt/ΔS²≤1。漂移、反应和边界仍需检查。

  5. 反向计算带。 标量输出伴随量从一开始,每条边把下游伴随量乘局部导数,累加到输入。通常基本运算成本模型下,每条边访问一次,工作量为计算带工作量的同阶,还需存储或重计算。分别传播全部n个输入方向需要n次前向扫描。计算带本身可随输入数增大,不存在通用墙钟倍数;多个输出可能需要更多反向扫描。

  6. 混合伽马。 现价、波动率和期限为正时,看涨路径德尔塔被积函数为D=exp(−rT)(ST/S₀)1{ST>K}。对终端对数正态密度求现价导数,得分为Z/(S₀σ√T)。固定ST时,D还显式含1/S₀,因此伽马为E[exp(−rT)ST/S₀²·1{ST>K}·(Z/(σ√T)−1)]。减一项不可遗漏。恒等式需要密度微分和可积条件;样本均值仍有抽样方差,不能再次直接对指标函数做朴素路径微分。

  7. 多层复杂度。 假设定理的正偏差、方差和成本指数,各层独立,并满足阿尔法至少为贝塔与伽马较小值一半等正则和整数分配条件。偏差按M的负阿尔法L次方下降,所以层数为误差倒数对数阶。贝塔等于伽马时,每项方差成本乘积的平方根有界,求和为层数阶。最优连续分配成本与误差负二次方乘该和的平方成比例,得到误差负二次方乘对数平方的复杂度。它不能认证自适应偏差代理量。

  8. 快速傅里叶步长。 设频率为jη,对数执行价为−b+mλ。反演指数中,与j、m同时相关的核为exp(−ijmηλ)。要匹配N点快速傅里叶核exp(−2πijm/N),必须ηλ=2π/N。固定η把N翻倍,执行价间距减半并扩展频率范围;固定N改变η则要权衡步长、截断和混叠。

  9. 格拉姆矩与对数正态矩。 独立同分布状态且四阶矩有限时,样本对角项方差为[Eψ⁴−(Eψ²)²]/N。二阶矩归一为一时,标准差为四阶矩减一除路径数后开平方。对S=exp(σW_t−σ²t/2),p阶矩为exp[(p²−p)σ²t/2]。代入归一化单项式,四阶矩为exp(4σ²tk²)。这只是单个对角项诊断,不能控制完整逆矩阵或价格误差;无条件分布也不同于价内回归分布。

  10. 单日期边界概率界。 真实继续价值与支付的差距为Δ。错误决策要求Δ不超过继续价值估计误差;零差距不产生损失。若一致误差不超过ε,则期望损失至多为εP(0<Δ≤ε)。若概率不超过Aε的阿尔法次方,损失上界就是Aε的一加阿尔法次方。线性边界条件产生带单位和常数的二次上界;误差减半使这个上界变为四分之一,不保证实际损失同比变化。多日期问题必须使用最优斯内尔继续价值和策略访问权重;去掉访问权重只能给出逐日期上界之和,不能写成朴素的全日期错误决策等式。

Build the film

python -m videos.quant.quant16.compute      # the part's numbers, into .cache/quant16
python tools/make.py quant16                # the narrated film, English and Chinese
EXPLAINER_TTS=silent python tools/qa_scene.py quant16 Hook   # one chapter, silent, with a contact sheet

Scenes: videos/quant/quant16. Setup: see the course page. Source of these notes: the part's README and the scenes' narration.