What is Monte Carlo Simulation?

Monte Carlo simulation uses repeated random sampling to model uncertain outcomes.

What it does?

  • Run the same scenario thousands of times with random inputs
  • See what happens in each version
  • Use all results to understand what’s likely to happen

Why it’s useful: When you can’t calculate the exact answer, simulate it!

Applications: Option pricing, risk management, portfolio optimization, engineering, physics, and prediction models!

Using Monte Carlo for Stocks

Stock prices go up and down randomly every day.

We can’t predict exactly where a stock will be in 1 year, but we can:

  • Simulate thousands of possible futures
  • See the range of outcomes
  • Understand the risks

This helps investors make better decisions

The Math Behind It

Stock prices follow this pattern:

\[\text{New Price} = \text{Old Price} \times e^{(\text{drift} - \frac{\text{volatility}^2}{2}) + \text{volatility} \times \text{random shock}}\]

Where:

  • Drift = average daily change
  • Volatility = how much prices bounce around
  • Random shock = unpredictable daily movement

Formula Breakdown

Breaking it down step by step:

\[S_{tomorrow} = S_{today} \times e^{(\mu - \frac{\sigma^2}{2})\Delta t + \sigma \sqrt{\Delta t} \cdot Z}\]

  • \(S\) = stock price
  • \(\mu\) = drift (average return)
  • \(\sigma\) = volatility (how wild the swings are)
  • \(Z\) = random number from normal distribution
  • \(\Delta t\) = time step (1 day)

MU Stock Prices Data

Running the Simulation

num_simulations = 100 #number of simulations to run
num_days = 252  #one year of trading
starting_price = tail(stock_data$Price, 1)

#an empty table to store results
price_simulations = matrix(NA, nrow = num_days + 1, 
                           ncol = num_simulations)
price_simulations[1, ] = starting_price

#for loop running n simulations
for(i in 1:num_simulations) {
  for(day in 2:(num_days + 1)) {
    random_shock = rnorm(1)
    price_simulations[day, i] = 
      price_simulations[day-1, i] * 
      exp((drift - 0.5*volatility^2) + volatility*random_shock)}}

Simulated Price Paths

3D Probability View

Real World Uses

Monte Carlo is used in many fields:

  • Finance: Stock predictions, option pricing, risk analysis
  • Engineering: Testing building designs under random conditions
  • Medicine: Modeling disease spread
  • Insurance: Calculating probabilities of claims
  • Gaming: AI chess engines use it to evaluate moves

Anywhere there’s uncertainty, Monte Carlo helps

Key Takeaways

What we learned:

  • Monte Carlo uses random simulations to predict uncertain outcomes
  • Stock prices can follow many different paths
  • By simulating thousands of scenarios, we see the range of possibilities
  • The 3D plot shows which prices are most likely over time
  • This helps manage risk in investing

Conclusion: we can’t predict the future exactly, but we can always understand the probabilities!