Lesson 13 of 15
Monte Carlo Pricing
Monte Carlo Pricing
Monte Carlo simulation is the most flexible method for pricing options. Instead of solving equations analytically, we simulate thousands of possible stock price paths and average the payoffs.
The Stock Price Model
Under risk-neutral measure, the stock price follows:
where Z ~ N(0, 1) is a standard normal random variable.
Monte Carlo Algorithm
- For each of n_paths simulations:
- Sample Z from N(0,1)
- Compute using the formula above
- Calculate the payoff: max(S_T - K, 0)
- Average all payoffs
- Discount at risk-free rate:
Generating Normal Samples: Box-Muller
To generate standard normal samples from uniform random numbers:
where U₁, U₂ are independent Uniform(0,1).
Accuracy
With n_paths = 10,000, the standard error is roughly σ/√n ≈ 1% of the price. More paths = more accuracy but slower computation.
Python runtime loading...
Loading...
Click "Run" to execute your code.