Monte Carlo Stock Simulator — GBM Price Paths
Simulate geometric Brownian motion stock paths with a seeded RNG: terminal distribution, convergence diagnostics, and exact lognormal quantile overlays.
Monte Carlo Simulation Calculator
A clear path from inputs to results.
For investors, students, and quants who want the distribution of outcomes behind an average return, not just the average. The simulator runs seeded geometric Brownian motion paths with the exact lognormal transition, then compares the Monte Carlo terminal distribution against the closed-form moments, so you see both the range of futures and how fast the simulation converges. It turns a drift and volatility pair into fan charts, quantiles, and probabilities such as the chance of finishing above a target.
How to use
- Set the initial price, the annual drift, and the annual volatility; these fix the exact lognormal terminal law.
- Choose the horizon in years and the number of time steps, which controls how finely each path is drawn (the transition itself is exact, not an Euler step).
- Pick the number of paths (64 to 4,096) and a seed; toggle antithetic variates to pair every path with its mirror image and cut estimator noise.
- Set a target level to read the probability of finishing above it under the exact lognormal law.
- Compare the Monte Carlo cards (mean, median, standard deviation, standard error) with the theoretical cards computed in closed form.
- Read the convergence monitor, the terminal histogram against the exact density, and the 3D density or quantile surface across time.
The formula
Reference: Hull, Options, Futures, and Other Derivatives (Wiener processes and Ito’s lemma); Glasserman, Monte Carlo Methods in Financial Engineering (2003) for path simulation and antithetic variates.
Worked example
Two years of a 24%-volatility stock with antithetic pairs
- S0 = 100, drift 8%, volatility 24%, horizon 2 years, 160 time steps, 512 paths, seed 20260624, antithetic on, target level 120.
- 1
The exact terminal law is lognormal: mean 100 x e^{0.16} = 117.3511, median 100 x e^{0.1024} = 110.7827, standard deviation 41.0054, and P(S_T > 120) = 0.4069. Simulating 512 seeded paths with antithetic pairing gives a sample mean of 117.0196 with a standard error of 1.8201, a relative error of 0.28% against the closed form, and a sample median of 110.6122. The mean maximum drawdown along the paths is 0.2971, information the terminal distribution alone cannot give.
Exact: mean 117.3511, median 110.7827, 5%-to-95% band 63.3889 to 193.6112, probability above 120 of 40.69%. Simulated (seed 20260624): mean 117.0196 with standard error 1.8201, median 110.6122, relative error 0.28%.
Interpreting the result
The median sits below the mean because the lognormal is right-skewed: typical paths underperform the average path, which is dragged up by a few large outcomes. The fan chart shows uncertainty growing roughly like the square root of time, and the convergence monitor shows the running mean settling onto the exact value with error shrinking like 1/sqrt(N). For planning, the quantiles and the above-target probability are the useful summaries; a 40.7% chance of beating 120 here is a statement about the model inputs, not a forecast.
Assumptions & limitations
- Geometric Brownian motion: log-normal prices with constant drift and volatility; no jumps, gaps, regime changes, or stochastic volatility.
- Path steps use the exact lognormal transition, so there is no discretization bias in the marginal law, but path-dependent features still depend on the step count.
- Monte Carlo results carry sampling error of order sigma-hat/sqrt(N); the 512-path default has a standard error near 1.8 on a 117 mean in this example.
- The seeded PRNG makes runs exactly reproducible; the seed selects the sample you see, not the accuracy for a given path count.
- Drift is an assumption you supply, and small changes in it compound exponentially over the horizon.
Frequently asked questions
How many Monte Carlo paths are enough?
It depends on the tolerance you accept: the standard error of the mean is sigma-hat/sqrt(N), so halving the error takes four times the paths. Watch the convergence monitor: when the cumulative mean stays comfortably inside one standard-error band of the exact value, N is doing its job. Antithetic pairing removes much of the noise for symmetric estimators at essentially no extra cost.
What is the difference between drift and median growth?
The drift mu is the expected continuously compounded growth of the price level, giving E[S_T] = S0 e^{mu T}; the median grows at mu minus sigma-squared over two, the volatility drag. With mu = 8% and sigma = 24% over two years, the mean is 117.35 but the median only 110.78, so half the paths end below that level.
What does P(S_T > target) assume?
Only the terminal lognormal distribution; it ignores the route the price takes to get there. Path features such as the mean maximum drawdown shown in the cards describe the journey, and they matter whenever stop losses, margin calls, or rebalancing rules react to intermediate levels.
Why is the simulated mean below the theoretical mean?
Sampling noise. With 512 paths the standard error is about 1.82, and the observed gap of 0.33 is roughly a fifth of that, well within one standard error. A different seed would land on the other side of the exact value just as often.
Why use the exact transition instead of an Euler discretization?
Geometric Brownian motion has a closed-form solution for each step, so sampling from it reproduces the true lognormal law at every date with no discretization error. Euler schemes would add bias that only shrinks with very fine steps, which buys nothing when the exact form is available.
Does changing the seed improve accuracy?
No; the seed only selects which random sample you draw, which is why every figure in the worked example is exactly reproducible. Accuracy comes from the path count and variance-reduction choices such as antithetic pairs. The seed exists to make the audit trail deterministic.
Methodology last reviewed 2026-10-06. Results are informational and not financial or engineering advice — see our disclaimer.