Monte Carlo pricing: exotics and Greeks
Price path-dependent options with Monte Carlo, variance reduction, Brownian bridges and simulation-based Greeks.
After this lesson you can
- Design a Monte Carlo pricer with confidence intervals for path-dependent payoffs.
- Separate discretization and statistical error and choose steps and paths for a fixed cost.
- Correct discrete-monitoring barrier bias with Brownian-bridge crossing probabilities.
- Use a geometric Asian option as a control variate and quantify variance reduction.
- Derive and implement pathwise and likelihood-ratio Greeks and identify when each works.
Before you start
- 28Black-Scholes formulaRisk-neutral measureMartingale pricing and change of numeraireOption GreeksMarket price of risk and equivalent martingale measure
- 09Monte Carlo estimatorMonte Carlo error and confidence intervals
- 29Antithetic variatesControl variatesLow-discrepancy sequences
- 26Constructions of Brownian motionBrownian bridge
- 04Differentiation under the integral sign
- 03Leibniz integral rule
- 05Score function
Simulating payoffs beyond terminal prices
A European call needs only ; an Asian depends on an average, a barrier option on a crossing and a lookback on an extremum. To price under risk-neutral measure , simulate the required state, calculate payoff , discount it and average:
In Monte Carlo pricing, is the sample standard deviation of already discounted payoffs. An approximate normal interval is ; it expresses simulation uncertainty under the model, not model error or grid bias. Independent units are individual paths, or pairs with antithetics. A seed makes the experiment reproducible; it does not improve precision.
For GBM with constant parameters, the exact transition on a grid is
Euler and its transition bias are unnecessary. Even so, exact nodes do not observe what happens between them: continuous monitoring of a barrier or maximum introduces another error. For path-dependent options, specify whether average, barrier or extremum is observed on particular dates or continuously. For an asset basket, a valid correlation matrix and its Cholesky factorization correlate shocks; innovation correlation is not automatically price correlation.
For a computational budget proportional to , more steps often reduce monitoring bias but leave fewer paths and greater statistical error. There is no universal optimal allocation: it depends on payoff, scheme, bias and cost criterion. A narrow interval from a biased grid can give a precise answer to the wrong problem.
The geometric Asian as a control
Let be the arithmetic average and the geometric average, observed at without . Log is normal and its call has a closed-form price. Exploit correlation between discounted payoffs and :
The geometric control variate does not change expectation if is fixed and is the correct price for the same dates. Estimating and evaluating on the same sample can introduce finite-sample bias; an independent pilot avoids that dependence. The variance-reduction factor is : if it equals 100, one controlled path has approximately the precision of 100 uncontrolled paths before pilot and computational costs. Antithetics average payoffs with and ; one pair is an independent observation and costs two paths.
The discrete geometric price follows from , where
The geometric call is . The formula changes if the average includes or dates are unequally spaced. The control does not turn an arithmetic average into a geometric one: it adjusts the estimator without replacing the contract.
The barrier crossed between nodes
Consider a down-and-out call with lower barrier and no rebate. Monitoring only at nodes may miss a crossing: discrete payoff is at least continuously monitored payoff on every path, so discrete price is upward biased relative to continuous price.
For endpoints , the log-price Brownian bridge gives conditional crossing probability
If an endpoint touches or crosses the barrier, . Conditional on all nodes, survival probability is ; multiplying terminal payoff by that product integrates hidden crossings and avoids simulating another coin flip. With GBM, constant barrier and constant parameters, it exactly corrects continuous monitoring conditional on nodes. It does not transfer unchanged to jumps or variable volatility. Broadie, Glasserman and Kou (1997) develop a different continuity correction that shifts the barrier to approximate discrete monitoring.
To check by another route, with , and , log-price reflection gives , where and both calls have the same maturity. The second term subtracts the effect of paths touching the barrier. This form depends on and no rebate; it cannot simply be reused for every contract.
Greeks by simulation
The pathwise method differentiates each path’s payoff when derivative and expectation can be exchanged. For the European call, and, except for the zero-probability event ,
The average estimates the derivative under integrability assumptions. For an Asian, replace by the average of and differentiate each node with respect to . For a digital, payoff is constant on almost every path but its expectation changes with : pathwise differentiation gives zero and fails because of discontinuity.
The likelihood-ratio method differentiates the density, not payoff: , under interchange conditions. In European GBM, the delta score is and vega score is . Scores handle digitals but can have high variance. For a full path, vega score sums increment scores and the score enters through the first transition. See Broadie and Glasserman (1996).
Central finite differences approximate the derivative using bump : if the same normals are used for and , the two valuations are correlated and their difference is often less noisy. Too large an causes bias; too small can amplify cancellation and noise, especially with independent seeds. Gamma and discontinuous barriers need extra treatment: repeating a pathwise derivative is not automatically valid.
Lab: exotic-option engine
The engine uses exact GBM nodes, discrete geometric price and an independent pilot sample for the control. The continuous barrier is also checked against a reflection formula for , with no dividends or rebate. The presented lookback observes the maximum only at nodes. Intervals ignore model uncertainty.
import numpy as np
from scipy.special import ndtr
def bs_call(S,K,r,sigma,T):
a=sigma*np.sqrt(T); d1=(np.log(S/K)+(r+.5*sigma*sigma)*T)/a; d2=d1-a
return S*ndtr(d1)-K*np.exp(-r*T)*ndtr(d2)
def geo_call(S,K,r,sigma,T,n):
m=np.log(S)+(r-.5*sigma*sigma)*T*(n+1)/(2*n); v=sigma*sigma*T*(n+1)*(2*n+1)/(6*n*n); a=np.sqrt(v)
return np.exp(-r*T)*(np.exp(m+v/2)*ndtr((m-np.log(K)+v)/a)-K*ndtr((m-np.log(K))/a))
def paths(seed,N,n,S=100.,r=.03,sigma=.25,T=1.):
g=np.random.default_rng(seed); dt=T/n; z=g.standard_normal((N,n)); logs=np.log(S)+np.cumsum((r-.5*sigma*sigma)*dt+sigma*np.sqrt(dt)*z,axis=1)
return np.column_stack((np.full(N,S),np.exp(logs)))
def summary(x):
mean=x.mean(); se=x.std(ddof=1)/np.sqrt(len(x)); return (round(mean,5),round(se,5),tuple(np.round([mean-1.96*se,mean+1.96*se],5)))
def asian(p,K=100.,r=.03):
a=p[:,1:].mean(axis=1); g=np.exp(np.log(p[:,1:]).mean(axis=1)); return np.exp(-r)*np.maximum(a-K,0),np.exp(-r)*np.maximum(g-K,0)
pilot=paths(281310,4000,32); xp,yp=asian(pilot); beta=np.cov(xp,yp,ddof=1)[0,1]/np.var(yp,ddof=1)
p=paths(281311,30000,32); x,y=asian(p); geom=geo_call(100,100,.03,.25,1,32); adjusted=x-beta*(y-geom)
print('asiática aritmética',summary(x),'control',summary(adjusted),'geométrica analítica',round(geom,5),'geométrica MC',summary(y))
print('beta piloto',round(beta,5),'factor varianza',round(np.var(x,ddof=1)/np.var(adjusted,ddof=1),2))
H=80.; dt=1/32; a,b=p[:,:-1],p[:,1:]; above=(a>H)&(b>H)
cross=np.where(above,np.exp(-2*np.log(np.maximum(a,H)/H)*np.log(np.maximum(b,H)/H)/(.25**2*dt)),1.)
pay=np.exp(-.03)*np.maximum(p[:,-1]-100,0); discrete=pay*(p.min(axis=1)>H); bridge=pay*np.prod(1-cross,axis=1)
power=2*(.03-.5*.25**2)/.25**2; continuous=bs_call(100,100,.03,.25,1)-(H/100)**power*bs_call(H*H/100,100,.03,.25,1)
print('barrera discreta',summary(discrete),'puente',summary(bridge),'continua analítica',round(continuous,5))
print('lookback discreta',summary(np.exp(-.03)*np.maximum(p.max(axis=1)-100,0)))In this run, plain arithmetic Asian gave 6.46012 with SE 0.05727; the independent control gave 6.55834 with SE 0.00195 and variance factor 859.25. Analytical geometric price was 6.25765 and estimated 6.16329 with SE 0.05490. The arithmetic estimators use the same paths and are correlated; their marginal intervals should not be treated as independent experiments.
g=np.random.default_rng(281312); N=30000; rho=.4; L=np.linalg.cholesky(np.array([[1.,rho],[rho,1.]])); z=g.standard_normal((N,2))@L.T
terminal=np.array([100.,95.])*np.exp((.03-.5*np.array([.2,.3])**2)+np.array([.2,.3])*z)
basket=np.exp(-.03)*np.maximum(terminal.mean(axis=1)-100,0)
print('correlación choques',round(float(np.corrcoef(z.T)[0,1]),4),'cesta',summary(basket))
for n in (12,64):
p=paths(281312+n,30000,n); a,b=p[:,:-1],p[:,1:]; above=(a>80)&(b>80)
cross=np.where(above,np.exp(-2*np.log(np.maximum(a,80)/80)*np.log(np.maximum(b,80)/80)/(.25**2/n)),1.)
pay=np.exp(-.03)*np.maximum(p[:,-1]-100,0)
print('pasos',n,'discreta',summary(pay*(p.min(axis=1)>80)),'puente',summary(pay*np.prod(1-cross,axis=1)))Simulations at different grid sizes use different seeds; a small difference should not be interpreted as established bias without comparing its standard error. The control also consumes the pilot sample and per-unit variance factor excludes that cost. For a continuous barrier price, the bridge removes crossing bias in this model but not Monte Carlo error.
With 32 intervals, the discrete barrier gave 11.02341 and the bridge 10.87616, with SE 0.10379 and 0.10359; the continuous reflection reference was 10.95520. The discrete lookback gave 19.80704 with SE 0.11005 and basket 8.35521 with SE 0.07900. These values apply only to the cells’ seeds and parameters.
Lab: Greeks and discontinuity
The same set of normals allows comparison of call and Asian methods. Each row reports mean, contribution standard deviation and standard error; different Greeks have different units. For the Asian, the vega score sums scores of all increments and can be much noisier.
g=np.random.default_rng(281313); N,n=30000,32; S,K,r,sigma,T=100.,100.,.03,.25,1.; dt=T/n
z=g.standard_normal((N,n)); W=np.cumsum(np.sqrt(dt)*z,axis=1); t=np.arange(1,n+1)*dt
prices=S*np.exp((r-.5*sigma*sigma)*t+sigma*W); terminal=prices[:,-1]; disc=np.exp(-r*T)
average=prices.mean(axis=1); call=disc*np.maximum(terminal-K,0); asian_pay=disc*np.maximum(average-K,0); active=average>K
score_delta=z[:,0]/(S*sigma*np.sqrt(dt)); score_vega=np.sum((z*z-1)/sigma-np.sqrt(dt)*z,axis=1)
pw_delta=disc*(terminal>K)*terminal/S; pw_vega=disc*(terminal>K)*terminal*(W[:,-1]-sigma*T)
asian_delta=disc*active*average/S; asian_vega=disc*active*np.mean(prices*(W-sigma*t),axis=1)
def report(name,arr): print(name,'media',round(arr.mean(),5),'sd',round(arr.std(ddof=1),5),'EE',round(arr.std(ddof=1)/np.sqrt(N),5))
for name,arr in [('call delta PW',pw_delta),('call delta LR',call*score_delta),('call vega PW',pw_vega),('call vega LR',call*score_vega),('asiática delta PW',asian_delta),('asiática delta LR',asian_pay*score_delta),('asiática vega PW',asian_vega),('asiática vega LR',asian_pay*score_vega)]: report(name,arr)
d1=(np.log(S/K)+(r+.5*sigma*sigma)*T)/(sigma*np.sqrt(T)); print('call delta y vega analíticas',ndtr(d1),S*np.exp(-d1*d1/2)/np.sqrt(2*np.pi)*np.sqrt(T))
digital=disc*(terminal>K); report('digital delta LR',digital*score_delta); print('digital pathwise ingenua',0.)The first-transition score is correct for the full path, but a call depending only on permits a lower-dimensional terminal score. Variance comparison depends on payoff and specific estimator. Equality in expectation does not imply equal finite-sample precision.
For the call, analytical delta was 0.59677; pathwise gave 0.60050 with SE 0.00355 and first-transition score 0.59098 with SE 0.02865. Analytical vega was 38.71469 and the path score had SE 4.24108 versus pathwise 0.46728. Naive digital pathwise gave zero, while its score estimated 0.01483 with SE 0.00089. These compare this sample, not a universal ranking of methods.
Exercises
Step 1 of 3. What is the derivative of S_T with respect to S₀?
Step 1 of 3. Which part of the lognormal density depends on S₀?
def control(pilot_x,pilot_y,x,y,mean_y):
raise NotImplementedError()Ideas to remember
Monte Carlo gives an interval for the model and grid estimator, not for the real world. The bridge integrates invisible crossings under GBM; the geometric Asian can reduce variance without changing payoff. Pathwise and score methods require different assumptions, and a discontinuity can invalidate pathwise differentiation.