σμimplied vol · KKmax(S−K,0)udβρᵢⱼfat tailsPnL · drawdownyield · TdSₜ = μSₜ dt + σSₜ dWₜC = S·N(d₁) − K·e⁻ʳᵀ·N(d₂)σₚ² = wᵀΣwd₁ = [ln(S/K) + (r + σ²⁄2)T] ⁄ σ√T∂V/∂t + ½σ²S²·∂²V/∂S² + rS·∂V/∂S − rV = 0Sharpe = (Rₚ − R_f) ⁄ σₚVaR₉₉ = μ − 2.33σρ = Cov(X,Y) ⁄ σₓσᵧE[Rₚ] = Σ wᵢ·E[Rᵢ]φ(x) = e^(−x²/2) ⁄ √2πE[Rᵢ] = R_f + βᵢ(E[Rₘ] − R_f)dXₜ = θ(μ − Xₜ)dt + σ dWₜσ²ₜ = ω + α·ε²ₜ₋₁ + β·σ²ₜ₋₁C − P = S − K·e⁻ʳᵀΔ = ∂V/∂S Γ = ∂²V/∂S²p = (e^(rΔt) − d) ⁄ (u − d)rₜ = ln(Pₜ ⁄ Pₜ₋₁)E[Xₜ₊₁ | ℱₜ] = Xₜf* = (bp − q) ⁄ bz = (x − μ) ⁄ σP(N=k) = λᵏe^(−λ) ⁄ k!Θ = −∂V/∂Tν = S·φ(d₁)·√Tmin wᵀΣw s.t. wᵀμ = μ*∫Σ∂∞λ
uantCraft AcademyRoadmapsSkills
Ctrl K
AO
+1.2k Learners
LoginJoin ↗
RoadmapsSkills
AO
+1.2k Learners
Login
  • English
  • Français
  • Español
  • العربية
  • Português
  • Deutsch
  • 日本語
  • 中文
σμimplied vol · KKmax(S−K,0)udβρᵢⱼfat tailsPnL · drawdownyield · TdSₜ = μSₜ dt + σSₜ dWₜC = S·N(d₁) − K·e⁻ʳᵀ·N(d₂)σₚ² = wᵀΣwd₁ = [ln(S/K) + (r + σ²⁄2)T] ⁄ σ√T∂V/∂t + ½σ²S²·∂²V/∂S² + rS·∂V/∂S − rV = 0Sharpe = (Rₚ − R_f) ⁄ σₚVaR₉₉ = μ − 2.33σρ = Cov(X,Y) ⁄ σₓσᵧE[Rₚ] = Σ wᵢ·E[Rᵢ]φ(x) = e^(−x²/2) ⁄ √2πE[Rᵢ] = R_f + βᵢ(E[Rₘ] − R_f)dXₜ = θ(μ − Xₜ)dt + σ dWₜσ²ₜ = ω + α·ε²ₜ₋₁ + β·σ²ₜ₋₁C − P = S − K·e⁻ʳᵀΔ = ∂V/∂S Γ = ∂²V/∂S²p = (e^(rΔt) − d) ⁄ (u − d)rₜ = ln(Pₜ ⁄ Pₜ₋₁)E[Xₜ₊₁ | ℱₜ] = Xₜf* = (bp − q) ⁄ bz = (x − μ) ⁄ σP(N=k) = λᵏe^(−λ) ⁄ k!Θ = −∂V/∂Tν = S·φ(d₁)·√Tmin wᵀΣw s.t. wᵀμ = μ*∫Σ∂∞λ
uantCraft AcademyRoadmapsSkills
Ctrl K
AO
+1.2k Learners
LoginJoin ↗
RoadmapsSkills
AO
+1.2k Learners
Login
  • English
  • Français
  • Español
  • العربية
  • Português
  • Deutsch
  • 日本語
  • 中文
Derivatives Pricing skill›Module 3 · Numerical methods for options›Topic 3.3·~1 hr 10 minAdvanced

American options by least-squares Monte Carlo

Skill positionModule 3 of 6 · Topic 3 of 3
3.3 American options by least-squares Monte Carlo
—Lab score— / 100Total XP—Streak—
Lecture0% read

9 min readCode examples: 6

  1. 01Why early exercise has a value
  2. 02Simulating prices
  3. 03A binomial tree as a check
  4. 04The Longstaff-Schwartz idea
  5. 05Full size and the right check
  6. 06An at-the-money put on SPY
  7. 07What you will build

On 21 August 2026 a one-year at-the-money put on SPY, with the index at 765.72, is worth 25.27 if it can only be exercised at expiry. If its holder may exercise it on any day, the same put is worth 28.41. The extra 3.14, about 12%, is the price of the freedom to choose the day. This topic prices that freedom with a simulation, and checks the answer with a tree.

01

Why early exercise has a value

Where we are. Forwards and futures have a fixed price. An option gives its holder a choice, and this topic is about the choice that a formula cannot handle: *when* to use it. A European option can be exercised only at expiry. An American option can be exercised on any day up to expiry.

DefinitionEarly exercise

Using an American option before expiry. For a put it can pay: if the price has fallen far enough, taking the strike now and putting the money to work earns interest, while waiting only risks the price rising again. For a call without dividends it never pays, so an American call is worth the same as a European one.

Black-Scholes prices the European put. The American put is worth at least as much, because it has every right the European one has and more. The difference is the early-exercise premium. It is largest when the put is deep in the money and interest rates are high, and zero when rates are zero.

Worked example 1. *Problem:* a one-year put on an asset at 100 with strike 100, interest 5% and volatility 20%: what do the European and the American price say? Then repeat for an asset at 60, far below the strike. *Plan:* use the Black-Scholes formula for the European put and a 500-step binomial tree for the American one. *Steps:* below.

main.pyPython
print(round(bs_put(100.0, 100.0, 0.05, 0.2, 1.0), 4), round(binomial_american_put(100.0, 100.0, 0.05, 0.2, 1.0, 500), 4))1print(round(bs_put(60.0, 100.0, 0.05, 0.2, 1.0), 4), round(binomial_american_put(60.0, 100.0, 0.05, 0.2, 1.0, 200), 4))2
5.5735 6.0888
35.1774 40.0
  1. 1At the money: European, then American.
  2. 2Deep in the money: European, then American.

*Check:* at the money the European put is 5.5735 and the American 6.0888, so the right to exercise early adds 0.5153. With the asset at 60 the European put is only 35.1774, which is *less than the payoff of 40 you could take at once*. The American put is worth exactly 40.0: exercise immediately. *What to notice:* the American price never falls below the payoff, and the formula for the European put cannot say when to stop. That is why we need a method that decides on every date.

02

Simulating prices

Monte Carlo prices an option by averaging over many possible futures. We model the price with geometric Brownian motion: in each small step dt the log of the price moves by a fixed drift plus a random shock.

S_(k+1) = S_k × exp( (r − σ²/2) × dt + σ × √dt × Z_k )(1)r interest rate, σ volatility, Z_k an independent standard normal number; the term σ²/2 keeps the average price growing at exactly r

Prices are drawn in a risk-neutral world, where the drift is the interest rate r. The price of a European put is then the average discounted payoff, exp(−r × T) × mean(max(K − S_T, 0)). All the randomness comes from one matrix Z of numbers, drawn with a seed so that the same seed always gives the same paths.

Worked example 2. *Problem:* simulate 20,000 paths of 50 steps for the asset of example 1, and price the European put from them. *Plan:* use simulate_gbm with seed 42, check the average final price against the forward price 100 × exp(0.05), and compare the put with Black-Scholes. *Steps:* below.

main.pyPython
paths = simulate_gbm(100.0, 0.05, 0.2, 1.0, 50, 20000, 42)1print(paths.shape, round(float(paths[:, -1].mean()), 4), round(100 * np.exp(0.05), 4))print(round(european_mc_put(paths, 100.0, 0.05, 1 / 50), 4), round(bs_put(100.0, 100.0, 0.05, 0.2, 1.0), 4))2
(20000, 51) 105.1088 105.1271
5.527 5.5735
  1. 1One row per path, fifty-one columns (the start and fifty steps).
  2. 2Simulated European price and the exact one.

*Check:* the array has 20000 rows and 51 columns. The average final price is 105.1088 against a forward price of 105.1271, so the paths grow at the right rate. The simulated put is 5.5270 and the exact one 5.5735: they differ by 0.0465, the random error of 20,000 paths. *What to notice:* the error shrinks only with the square root of the number of paths, so a hundred times more paths gives ten times more accuracy.

03

A binomial tree as a check

Before trusting a simulation of something new, find a slower method that you believe. For American options it is the binomial tree. Cut the time to expiry into n steps; in each step the price multiplies by u or by d = 1/u. At expiry the value of every node is the payoff. Then step back: the value of a node is the *larger* of the payoff now and the discounted average of the two nodes after it.

V = max( K − S , exp(−r × dt) × ( p × V_up + (1 − p) × V_down ) )(2)u = exp(σ√dt), d = 1/u, p = (exp(r × dt) − d) / (u − d); the first term is exercising now, the second is waiting one step

Worked example 3. *Problem:* how fast does the tree converge, and what happens when interest is zero? *Plan:* price the at-the-money put with 50 and 500 steps, then with a zero rate and compare with Black-Scholes. *Steps:* below.

main.pyPython
print(round(binomial_american_put(100.0, 100.0, 0.05, 0.2, 1.0, 50), 4), round(binomial_american_put(100.0, 100.0, 0.05, 0.2, 1.0, 500), 4))1print(round(binomial_american_put(100.0, 100.0, 0.0, 0.2, 1.0, 500), 4), round(bs_put(100.0, 100.0, 0.0, 0.2, 1.0), 4))2
6.0737 6.0888
7.9616 7.9656
  1. 1The same put with 50 and with 500 steps.
  2. 2A zero interest rate: American against European.

*Check:* the tree gives 6.0737 with 50 steps and 6.0888 with 500, so it settles within a few thousandths. With a zero rate the American price is 7.9616 against 7.9656 for the European put: the two agree up to the small error of the tree, because exercising early earns no interest on the strike. *What to notice:* the tree is exact for a given number of dates but cannot handle many risk factors; a simulation can. We use the tree as the referee.

04

The Longstaff-Schwartz idea

The problem with simulation is that it looks forward, while the exercise decision needs the *expected value of waiting*, which is also a look forward. Least-squares Monte Carlo (LSM) solves it by going backwards through the same paths and estimating that expected value by regression.

DefinitionContinuation value

The expected value of not exercising today and following the best plan afterwards. The holder exercises when the payoff now is larger than the continuation value.

At each date, from the last one down to the first, take the paths where the option is in the money. For them, regress the discounted cash flow that they receive later on a polynomial of today's price. The fitted value is the continuation value as a function of the price. Where the payoff now is larger, exercise: replace the cash flow by the payoff now. Paths out of the money are not used in the regression because they would not be exercised anyway.

Worked example 4. *Problem:* the original example of Longstaff and Schwartz: 8 paths of a price starting at 1.00, observed on three later dates, an American put with strike 1.10 and a rate of 6% per step. What is the price? *Plan:* run lsm_put on the table of prices and compare with the European price on the same paths. *Steps:* below.

main.pyPython
table = np.array([[1.0, 1.09, 1.08, 1.34], [1.0, 1.16, 1.26, 1.54], [1.0, 1.22, 1.07, 1.03], [1.0, 0.93, 0.97, 0.92],                  [1.0, 1.11, 1.56, 1.52], [1.0, 0.76, 0.77, 0.90], [1.0, 0.92, 0.84, 1.01], [1.0, 0.88, 1.22, 1.34]])print(round(lsm_put(table, 1.10, 0.06, 1.0), 4), round(european_mc_put(table, 1.10, 0.06, 1.0), 4))1
0.1144 0.0564
  1. 1American by LSM, then European on the same paths.

*Check:* the LSM price is 0.1144, the European price on the same paths 0.0564: the right to exercise early doubles the value. At the second date five paths are in the money (prices 1.08, 1.07, 0.97, 0.77, 0.84), and only those five enter the regression of their later cash flows on the price. *What to notice:* the regression turns eight scattered outcomes into a rule that depends only on today's price. Eight paths are far too few to trust; the point is to follow the steps.

Low by construction

The LSM rule is a rule that you can follow, so it can never beat the best rule. Its price is therefore a little *below* the true American price (apart from the random error). A higher polynomial degree or more exercise dates moves it up. This is why we compare with a tree.

05

Full size and the right check

Worked example 5. *Problem:* price the at-the-money put of example 1 with LSM on the 20,000 paths of example 2. *Plan:* run lsm_put with degree 2 and 3, and compare with the European price on the same paths and a 50-date tree (the paths have 50 steps, so the exercise dates match). *Steps:* below.

main.pyPython
paths = simulate_gbm(100.0, 0.05, 0.2, 1.0, 50, 20000, 42)print(round(european_mc_put(paths, 100.0, 0.05, 1 / 50), 4), round(lsm_put(paths, 100.0, 0.05, 1 / 50), 4), round(lsm_put(paths, 100.0, 0.05, 1 / 50, degree=3), 4))1print(round(binomial_american_put(100.0, 100.0, 0.05, 0.2, 1.0, 50), 4))2
5.527 6.0395 6.0546
6.0737
  1. 1European, then LSM with degree 2 and 3.
  2. 2The 50-date tree as the referee.

*Check:* the European price on these paths is 5.5270, LSM gives 6.0395 (degree 2) and 6.0546 (degree 3), and the 50-date tree 6.0737. LSM is within 0.034 of the tree and sits just below it, as the note predicted. It has recovered most of the early-exercise value: from 5.5270 up to 6.0395. *What to notice:* the European price on the same paths is the *floor* of the American one, and the tree is the *ceiling* up to random error. If your LSM price is outside that range, there is a bug.

06

An at-the-money put on SPY

Worked example 6. *Problem:* price a one-year at-the-money put on SPY with real inputs: the last close, the 1-year Treasury yield, and the volatility of the last 252 daily returns. *Plan:* study does this and prices the put with Black-Scholes, the European simulation, the 500-step tree and LSM. *Steps:* below.

main.pyPython
out = study(load_data())1print(round(out["spot"], 2), round(out["rate"], 4), round(out["vol"], 4))2print([round(out[k], 4) for k in ("black_scholes", "european_mc", "binomial", "lsm", "premium")])
765.72 0.0403 0.1287
[25.2724, 25.01, 28.4087, 28.1386, 3.1363]
  1. 1The inputs, read from the data.
  2. 2Four prices and the premium.

*Check:* the spot is 765.72, the rate 4.03% and the realised volatility 12.87%. Black-Scholes gives 25.2724, the European simulation 25.0100, the American tree 28.4087 and LSM 28.1386. The right to exercise early is worth 3.1363 (the tree minus Black-Scholes), about 12% of the European price. *What to notice:* LSM minus Black-Scholes is 2.87, a little less than the 3.14 of the tree, as expected from a rule that is only an approximation of the best one.

Do not trust one run

A Monte Carlo price comes with a random error. Changing the seed changes the third decimal. Report the number of paths with the price, check against a second method, and never compare two prices from different seeds as if the gap meant something.

  • FunctionQuestion it answers
  • simulate_gbm(spot, rate, vol, years, steps, paths, seed)What could the price do?fixed seed, one matrix of shocks
  • bs_put(spot, strike, rate, vol, years)What is the European put worth?closed formula
  • european_mc_put(paths, strike, rate, dt)What does a simulation say for the European put?mean discounted payoff
  • binomial_american_put(spot, strike, rate, vol, years, steps)What is the American put worth on a tree?the referee
  • lsm_put(paths, strike, rate, dt, degree)What is the American put worth by regression?backward, in-the-money paths only
What the real data saysSPY on 21 August 2026, 1-year Treasury yield 4.03%, realised volatility 12.87%, a one-year at-the-money put
European put (Black-Scholes)25.27exercise only at expiry
American put (500-step tree)28.41exercise on any day
American put (LSM)28.1420,000 paths, 50 dates, degree 2
Early-exercise premium3.14about 12% of the European price

Key takeaways

  • An American option adds a choice. It can be exercised any day, so it is worth at least the European one; the extra is the early-exercise premium.
  • Simulation prices by averaging. Simulate risk-neutral paths with a fixed seed and take the mean discounted payoff; the error falls as one over the square root of the number of paths.
  • LSM learns the exercise rule. Go backwards; on the in-the-money paths regress the discounted later cash flow on the price; exercise where the payoff now is larger.
  • Always check with a second method. The European price on the same paths is the floor, a tree is the ceiling; LSM sits just below the true price.
Quick check
Your turn. At one date of an LSM run, a path has an asset price of 80 and the put has strike 100. The regression gives a continuation value of 17 at that price. What does the method do with that path?
Pick an answer.
07

What you will build

The lab follows the lecture. Task 1 simulates the price paths and task 2 writes the Black-Scholes put. Task 3 prices the European put on the paths, and task 4 writes the binomial tree that serves as the check. Task 5 is the heart of the topic: the least-squares method. Task 6 prices a put on real SPY data four ways and measures the early-exercise premium.

Next topic: this topic priced options on a stock. The next one, Interest-rate options and Black-76, prices caps and floors on interest rates, with the formula that fixed income desks use for them.

Lab · what's graded

6 tasks · 100 pts
  • Simulating prices15 pts
  • The Black-Scholes put10 pts
  • The European put by simulation10 pts
  • A binomial tree15 pts
  • Least-squares Monte Carlo30 pts
  • A put on SPY20 pts
Explorer · lab-dv-03
▾ lab-dv-03
▾ data
…
bash · in-browser
learner@quantcraft:~/lab-dv-03$
Python not loaded yetPythonLn 1, Col 1Spaces: 4UTF-8

Reset this topic?

Everything in lab-dv-03 goes back to the starter files and the terminal is cleared. Your current solution will be lost — this can't be undone.

Will be reset
  • main.py → starter code
  • Terminal history and test output
  • Unsubmitted changes
Will be kept
  • Best lab score
  • Your XP and streak
  • Lecture progress and notes