Hard · Numerical Methods & Monte Carlo · Coding · ~20 min · #45
Monte Carlo European Call
Price a European call by Monte Carlo under risk-neutral geometric Brownian motion:
Implement mc_european_call(S0, K, T, r, sigma, n_paths, seed) -> float. Use random.Random(seed) so results are reproducible. Your estimate will be compared against the Black–Scholes price with a tolerance of 0.25 (about five standard errors at 100,000 paths).
Constraints
- •
Use only the Python standard library.
- •
n_paths = 100,000 in the tests; keep the loop simple.
Hints · 0 of 2 shown
Worked solution
Give the problem an honest attempt first, then reveal the full explanation.
Related questions
Concepts
Risk-neutral pricingMonte Carlo estimationConvexity correction
Relevant for
Quant DeveloperQuant ResearcherDesk Quant