Skip to main content
added 52 characters in body
Source Link
Quantuple
  • 14.8k
  • 1
  • 33
  • 70

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, when you incrementally computeiteratively updating the average payoff each time you simulateare done with generating a new path as he suggests, you can store the running average andallows to free most of the memory afterwards 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 if we runwith 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 dependingbased on your own constraints (for instance matlab uses a quite limited java heap size by deault).

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, when you incrementally compute the average payoff each time you simulate a new path as he suggests, you can store the running average and free the memory afterwards.

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 if we run 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 wisely depending on your own constraints (for instance matlab uses a quite limited java heap size by deault).

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).

Source Link
Quantuple
  • 14.8k
  • 1
  • 33
  • 70

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, when you incrementally compute the average payoff each time you simulate a new path as he suggests, you can store the running average and free the memory afterwards.

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 if we run 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 wisely depending on your own constraints (for instance matlab uses a quite limited java heap size by deault).