Streaming Monte Carlo Payoff Averages to Reduce Memory Use
Summary
The document contrasts two ways to estimate an option price by Monte Carlo simulation. One method processes each simulated path, calculates its payoff, and updates a running average; the other stores all paths before calculating and averaging their payoffs. Since the price estimate only needs the aggregate payoff, retaining every path is unnecessary when paths can be handled sequentially.
The answer attributes this streaming approach mainly to lower memory use: it can support very large simulation counts without keeping the full path set in memory. Storing paths may still be useful in environments that benefit from vectorized operations, so the practical choice depends on memory limits and implementation characteristics. The discussion is a general implementation comparison and does not address variance reduction, estimator accuracy, or the details of pricing particular option structures.
Key ideas
- Monte Carlo option pricing can update a running average as each path payoff is produced.
- Streaming the calculation avoids storing all simulated paths and reduces memory requirements.
- Storing paths may enable vectorized computation in some programming environments.
- The implementation choice depends on memory constraints and language-specific performance.
Tags
Full text
# Monte Carlo Option Pricing: Averaging Price Per Path # Monte Carlo Option Pricing: Averaging Price Per Path In Glasserman's book, he computes the price of an option by first computing the average price over each simulated price path. Once all the paths have been simulated, the average of all the payoffs is computed using the average price of each simulated path. In the finance courses I have taken, the algorithm I have been taught is to compute all the simulated price paths, work out the payoff of each path and then take the average payoff which is then discounted. Glasserman's algorithm involves more computation steps since for each price path I have to compute this average price. Why does Glasserman take this approach? Also if there is anybody working in the industry, what algorithm is actually taken to pricing vanilla options i.e. does industry follow the textbook approach or do they apply any other optimisation techniques? ## Answer by Quantuple (score 1) https://quant.stackexchange.com/a/25134 Although I don't remember this part of the book explicitly, I guess Glasserman implements Monte Carlo this way to preclude memory-related issues. Indeed, iteratively updating the average payoff each time you are done with generating a path allows to free most of the memory after each Monte Carlo simulation: you only need to store the running average. On the other hand, the second approach you mention requires simulating and storing all the paths before you get to compute the average payoff. In other words, Glasserman's implementation will work even with thousands of millions of Monte Carlo simulations, while on most work stations the second method would fail (not enough memory). Note that in certain programming languages, the second approach can benefit from vectorisation (I'm thinking matlab and the likes). Hence you should choose your implementation wisely based on your own constraints (for instance matlab uses a quite limited java heap size by deault).
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.