Numerical Methods: How Computers Actually Price Derivatives
We have reached the final part of Wilmott’s massive book. Part Six: Numerical Methods and Programs. This is where all the theory meets reality. Because in practice, you almost never get a nice closed-form formula. You get a PDE and a computer.
Chapter 76 is an overview chapter. It sets the stage for everything that follows by explaining the three main numerical approaches, when to use each one, and how fast they are. Think of it as the map before the journey.
Why Numerical Methods?
Wilmott is direct about this. He uses finite-difference methods about 75% of the time, Monte Carlo simulations 20%, and explicit formulas the remaining 5%. And those formulas are almost always just the regular Black-Scholes for calls and puts. Never for barriers, where constant volatility is “highly dangerous.”
The reason is simple. Real financial problems are messy. You have time-dependent volatility, stochastic interest rates, path dependence, early exercise features, barriers, multiple underlyings. Almost none of these have closed-form solutions. You need a computer to crunch the numbers.
The three approaches are:
- Finite-difference methods (solve the PDE on a grid)
- Monte Carlo simulation (simulate random paths)
- Numerical integration (evaluate integrals directly)
Each has strengths and weaknesses. The art is knowing which to pick.
Finite-Difference Methods
Finite differences work by placing a grid over your problem (stock price on one axis, time on the other) and approximating the derivatives in the PDE with differences between neighboring grid points. If you have done the binomial model, you already know the basic idea. Finite differences are the grown-up version.
The key questions for any problem are:
How many dimensions? Is it one underlying or many? Any strong path dependence? Finite differences work extremely well up to about four dimensions (time plus three others). Above that, they get slow. The explicit method can technically handle more dimensions, but you will wait a long time.
What are the coefficients? For equities it is lognormal. For interest rates there are many models. Numerically, it does not matter. You do not need a specific functional form. The method works regardless.
What are the boundary conditions? In code, the difference between a call and a put is just the final condition. Barriers show up as boundary conditions. Write your code so that changing the contract means changing one function, not rewriting the whole program.
Are there embedded decisions? American exercise, installment premiums, chooser features. These are trivially easy with finite differences. The difference between a European and an American option is about three lines of code and less than a minute of work.
Linear or nonlinear? Most finance models are linear. Some newer ones are not. Finite differences handle both without much trouble.
Efficiency
The computation time for finite differences scales as:
$$\text{Time} \sim M \cdot \epsilon^{-(1 + d/2)}$$
where M is the number of options in the portfolio, epsilon is your desired accuracy, and d is the number of spatial dimensions. For a single underlying (d=1), this is manageable. For two underlyings (d=2), it gets expensive. For three, you start thinking about alternatives.
The big win: you get the Greeks for free. Since you compute the option value at all grid points, delta and gamma are just differences between neighboring values. No extra computation needed. (Vega does require a separate run though.)
Suggested Learning Path
Wilmott lays out a step-by-step program:
- Explicit method for European calls and puts (easy to start with)
- Explicit method for American options (add three lines of code)
- Crank-Nicolson for Europeans (harder but more accurate)
- Crank-Nicolson for Americans (not much harder)
- Explicit method for path-dependent options (Asians, lookbacks)
- Interest rate products (caps, floors, index amortizing swaps)
- Two-factor explicit (convertible bonds with stochastic rates)
- Two-factor implicit (the final boss)
Monte Carlo Methods
Monte Carlo methods simulate the randomness directly. You generate thousands of random paths for the stock price (using the risk-neutral drift, not the real drift), calculate the payoff on each path, and average them. The option value is just the expected present value.
The same checklist applies:
Dimensions? Monte Carlo loves high dimensions. Each extra random factor just means simulating one more time series. The time is proportional to the number of factors. This makes Monte Carlo ideal when finite differences would crawl.
Coefficients? Same as finite differences: it does not matter much in practice.
Embedded decisions? Here is the big weakness. Monte Carlo gives you the option value at today’s price and time. But for American options, you need to know the value at every point in stock-price-time space to make the exercise decision. You do not get that naturally from simulation. There are workarounds (like Longstaff-Schwartz regression), but it is never as clean as finite differences.
Nonlinear models? Monte Carlo also struggles here. Some models do not have interpretations in terms of probabilities and expectations, so simulation-based methods do not apply.
Efficiency
The computation time scales as:
$$\text{Time} \sim \epsilon^{-2} \cdot d$$
The key difference from finite differences: the dependence on dimension d is linear, not exponential. For high-dimensional problems (many underlyings), Monte Carlo wins. But the 1/epsilon^2 scaling means that getting high accuracy is expensive. To halve the error, you need four times as many simulations.
On the plus side, you can price many options on the same simulation paths. Greeks are more expensive, requiring extra simulations.
Suggested Learning Path
- European options on a single stock (one random walk, one payoff)
- Path-dependent options (barriers, Asians, lookbacks)
- Multi-asset options (correlated random walks)
- Interest rate derivatives with spot rate models
- HJM model (one factor, then two)
- BGM model (discrete version of HJM)
Numerical Integration
Sometimes you can write the option value as an integral. The value is the expected payoff, which mathematically is:
$$V = \int \text{Payoff}(S_T) \cdot p(S_T) , dS_T$$
where p is the risk-neutral probability density. This is possible when:
- The option is European (no early exercise)
- The underlying SDE is explicitly integrable (lognormal is perfect)
- The payoff is not path-dependent (usually)
When all three conditions hold, pricing reduces to evaluating an integral. This is fast.
Efficiency
With regular random numbers (Monte Carlo integration):
$$\text{Time} \sim M \cdot \epsilon^{-2}$$
With low-discrepancy sequences (quasi-random numbers that fill space more evenly):
$$\text{Time} \sim M \cdot \epsilon^{-1} \cdot (\log \epsilon^{-1})^d$$
Low-discrepancy sequences are clever. They look random but avoid the clustering that truly random numbers have. This makes convergence much faster. The downside: numerical integration is only applicable to a narrow class of problems. No early exercise, no path dependence, no stochastic volatility.
Suggested Learning Path
- European calls on a single stock using normal random numbers
- Multi-asset European options using normal random numbers
- Same with arbitrary payoff functions (just change one function)
- Same but switch to low-discrepancy sequences
Choosing Your Method
Here is the decision tree:
Low dimensions (1-3 factors), embedded decisions (American, callable)? Use finite differences. This is the bread and butter.
High dimensions (4+ factors), European-style? Use Monte Carlo. Time scales linearly with dimension.
European, lognormal, no path dependence? Use numerical integration for speed. Especially with low-discrepancy sequences.
Nonlinear models? Finite differences. Monte Carlo struggles, and integration is not applicable.
In practice, most quants use finite differences as their default and reach for Monte Carlo when the dimension gets too high. Numerical integration is a nice speedup for special cases. Wilmott calls this last part “the home straight.” We are close to the end of the book, and these numerical chapters are where theory becomes code.
The Takeaway
Numerical methods are not an afterthought. They are the core of practical quantitative finance. The prettiest PDE is worthless if you cannot solve it. Finite differences are the workhorse: flexible, efficient for low dimensions, great for American options and nonlinear models. Monte Carlo is the high-dimensional specialist. Numerical integration is fast but limited.
If you master these three approaches, you can price essentially anything. The rest is just details: which grid to use, how to handle boundaries, how to reduce variance. Important details, but details you learn by doing.
Wilmott says that if you get through all the programs of study he suggests, you will have reached a very high level of sophistication. He is right. Let us get started.
Previous post: Bonus Time: The Math of Wall Street Bonuses
Next post: Finite Difference Methods: Solving PDEs on a Grid