Project 4: Monte Carlo Simulator for Stock Prices
Build a simulator that generates price paths using geometric Brownian motion.
Project Overview
| Attribute | Value |
|---|---|
| Difficulty | Level 2: Intermediate |
| Time Estimate | Weekend |
| Main Language | Python |
| Alternative Languages | R, JavaScript |
| Knowledge Area | Stochastic modeling |
| Tools | Plotting library |
| Main Book | “Options, Futures, and Other Derivatives” by John Hull |
What you’ll build: A simulator that generates thousands of possible future price paths.
Why it teaches quant: It makes volatility and randomness explicit and measurable.
Core challenges you’ll face:
- Estimating drift and volatility
- Generating random shocks
- Interpreting simulation distributions
Real World Outcome
You will produce simulated price paths and probability distributions of future prices.
Example Output:
$ python monte_carlo.py --symbol AAPL --days 252 --paths 1000
Simulated paths: 1000
Saved chart to charts/paths.png
Verification steps:
- Compare simulated mean/variance to historical estimates
- Check distribution shape
The Core Question You’re Answering
“How do I model the uncertainty of future prices using randomness?”
Monte Carlo turns volatility into distributions.
Concepts You Must Understand First
Stop and research these before coding:
- Geometric Brownian motion
- Why is GBM the standard model for prices?
- Book Reference: “Options, Futures, and Other Derivatives” by John Hull, Ch. 13
- Volatility estimation
- How do you estimate volatility from returns?
- Book Reference: “Quantitative Trading” by Ernest Chan, Ch. 2
- Random sampling
- Why do normal distributions appear in price models?
- Book Reference: “An Introduction to Statistical Learning” by James et al., Ch. 2
Questions to Guide Your Design
- Parameter estimation
- Will you use historical mean/variance or user input?
- How will you annualize volatility?
- Output interpretation
- How will you summarize results (percentiles, histograms)?
- How will you show path variability clearly?
Thinking Exercise
Drift vs Volatility
If drift is small but volatility is large, what does the distribution of outcomes look like?
Questions while working:
- Why does volatility dominate long-term outcomes?
- How does time horizon change spread?
The Interview Questions They’ll Ask
Prepare to answer these:
- “What is geometric Brownian motion?”
- “How do you estimate volatility from data?”
- “Why do we use log returns in GBM?”
- “What is the effect of time horizon on variance?”
- “What are the limitations of Monte Carlo models?”
Hints in Layers
Hint 1: Starting Point Start with a fixed drift and volatility.
Hint 2: Next Level Generate random shocks using a normal distribution.
Hint 3: Technical Details Use log returns for numerical stability.
Hint 4: Tools/Debugging Check that simulated returns match target mean and variance.
Books That Will Help
| Topic | Book | Chapter |
|---|---|---|
| GBM | “Options, Futures, and Other Derivatives” by John Hull | Ch. 13 |
| Volatility | “Quantitative Trading” by Ernest Chan | Ch. 2 |
| Random sampling | “An Introduction to Statistical Learning” by James et al. | Ch. 2 |
Implementation Hints
- Set random seeds for reproducibility.
- Keep parameter units consistent (daily vs annualized).
- Plot both paths and histograms for insight.
Learning Milestones
- First milestone: You can simulate GBM price paths.
- Second milestone: You can interpret distribution outputs.
- Final milestone: You can explain model assumptions and limits.