Monte Carlo estimation
Turn expectations into estimators with visible uncertainty.
01Build a seeded path estimator
02Report standard error and confidence intervals
03Separate sampling error from model error
Name the mathematical target and the approximation error.
Monte Carlo returns an estimate and an error bar; a price without both is incomplete.
Error decays as N⁻¹ᐟ².
Seeding makes diagnostics reproducible.
Discount pathwise before averaging.
Tie accuracy to the decision the number supports.
Path-dependent and high-dimensional claims often have no tractable closed form.
Asian options
callables
xVA exposure
Prices are present values; confidence levels and seeds are explicit.
Separate estimator, discretization, truncation, and convergence.
Estimator
The sample mean is unbiased when paths and discounting match the target law.
Full derivation
From information set to computable quantity
Each line states the information, measure and unit before manipulating the expression.
- 01
Express price as expectation
Fix measure, numeraire and payoff.
- 02
Generate iid draws
Map deterministic pseudorandom uniforms to the model factors.
- 03
Average discounted payoffs
Compute the estimator and unbiased sample variance.
- 04
Attach uncertainty
Use a CLT interval only after checking tail behaviour and independence.
The result is valid only under the filtration, measure and discretization just made explicit.
Inputs
N: path countŶ: discounted sample payoff
Assumptions and limits
- Convergence is slow for tight tolerances.
- Discontinuous payoffs produce noisy sensitivities.
Standard error
Quadrupling paths roughly halves sampling uncertainty.
Benchmark the algorithm against a controlled reference.
Simulate under the pricing measure, discount pathwise and report estimate, standard error, seed and runtime.
Simulation parameters inherit the calibrated model; path count controls numerical precision, not fit.
06PYTHON IMPLEMENTATIONOpen the implementation and checks.
- Typed domain validation
- Deterministic seeded computation
- Readout plus invariant
Monte Carlo estimation
Reproduce the governing quantity, then challenge it with an invariant.
import numpy as np def widehatvnfracnsumi(x: np.ndarray) -> float: x = np.asarray(x, dtype=float) assert np.isfinite(x).all() return float(np.mean(x)) sample = np.array([0.8, 1.0, 1.2])value = widehatvnfracnsumi(sample)assert sample.min() <= value <= sample.max()print(f"value={value:.6f}")Change the error budget, not just the picture.
Monte Carlo estimation
Use a fixed seed to separate discretization, sampling and truncation effects.
Exact, Euler and Milstein spot paths using the same shocks.
- exact
- Euler
- Milstein
Use Left/Right or Up/Down arrows to inspect values; Home and End jump to the bounds.
Model → algorithm → evidence
Each numerical approximation has an independent control and a reference diagnostic.
Q / GBMMeasure and SDE fixed
32 stepsDiscretization or transform control
SE=0.211Visible convergence evidence
Where the model meets the book.
“The sixth decimal is not information when the error bar starts at the third.”
model state
path count
seed
Simulation parameters inherit the calibrated model; path count controls numerical precision, not fit.
RISKsampling error
tail under-sampling
- Validate market state and timestamp
- Recompute the baseline
- Run a controlled perturbation
- Explain P&L and residuals
Production failure modes
- Silent convention or measure changes
- Unstable numerics hidden by plausible prices
09MACRO CONNECTIONOpen the transmission channel.
Transmission from state to valuation
The causal chain separates the economic shock from the modelling response.
transmitsdefines scenarios
transmitssamples payoffs
outputgoverns numerical confidence
10COMMON PITFALLSOpen the failure checklist.
Reporting only the mean
Changing seed during regression tests
11SOURCES / FURTHER READINGOpen sources and continue the track.
Measure theory, simulation and computational-finance lectures
The lesson uses original prose and a fresh typed implementation; the linked material is a research map, not copied product code.
- Source
- Computational Finance Course
- Author
- L. A. Grzelak
- Ref
- main