Integrals by sampling
A multiple integral adds up a function over a region, . Few of them can be solved by hand, yet finance is full of them: the expected payoff of a derivative, the probability of a loss, the price of a basket option are all integrals over many dimensions.
Monte Carlo estimates the integral by sampling. Draw random points uniformly in a region of known volume that contains the domain, average over them and multiply by . The estimate is itself random, with a standard error : to cut the error in half you need four times as many points.
Its great advantage is dimension. A grid with 10 points per axis needs points in dimensions, which is for . Monte Carlo's error still shrinks like whatever is. For areas and volumes it reduces to hit-or-miss: the fraction of random points that land inside the shape, times the volume of the box.
- Estimate: times the average of over uniform random points.
- Standard error: ; four times the points halve it.
- Hit-or-miss: area or volume is the fraction of points inside times the box volume.
Two runs with different seeds give slightly different estimates, because the estimate is random. Always report the standard error next to the value, and fix the seed when you need a result you can reproduce, as the labs of this course do.
Lab · what's graded
7 tasks · 100 pts- An exact double integral15 pts
- The standard error15 pts
- How many more points15 pts
- A volume by hit-or-miss15 pts
- Why Monte Carlo in many dimensions10 pts
- The Monte Carlo recipe10 pts
- Why sampling works20 pts