Fourier, Wavelet and Monte Carlo Methods in Computational Finance
Kees Oosterlee1,2
1CWI, Amsterdam 2Delft University of Technology, the Netherlands AANMPDE-9-16, 7/7/2016
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 1 / 51 Joint work with Fang Fang, Marjon Ruijter, Luis Ortiz, Shashi Jain, Alvaro Leitao, Fei Cong, Qian Feng
Agenda
Derivatives pricing, Feynman-Kac Theorem Fourier methods Basics of COS method; Basics of SWIFT method; Options with early-exercise features COS method for Bermudan options Monte Carlo method BSDEs, BCOS method (very briefly)
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 1 / 51 Agenda
Derivatives pricing, Feynman-Kac Theorem Fourier methods Basics of COS method; Basics of SWIFT method; Options with early-exercise features COS method for Bermudan options Monte Carlo method BSDEs, BCOS method (very briefly) Joint work with Fang Fang, Marjon Ruijter, Luis Ortiz, Shashi Jain, Alvaro Leitao, Fei Cong, Qian Feng
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 1 / 51 Feynman-Kac theorem: Z T v(t, x) = E g(s, Xs )ds + h(XT ) , t
where Xs is the solution to the FSDE
dXs = µ(Xs )ds + σ(Xs )dωs , Xt = x.
Feynman-Kac Theorem
The linear partial differential equation: ∂v(t, x) + Lv(t, x) + g(t, x) = 0, v(T , x) = h(x), ∂t with operator 1 Lv(t, x) = µ(x)Dv(t, x) + σ2(x)D2v(t, x). 2
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 2 / 51 Feynman-Kac Theorem
The linear partial differential equation: ∂v(t, x) + Lv(t, x) + g(t, x) = 0, v(T , x) = h(x), ∂t with operator 1 Lv(t, x) = µ(x)Dv(t, x) + σ2(x)D2v(t, x). 2
Feynman-Kac theorem: Z T v(t, x) = E g(s, Xs )ds + h(XT ) , t
where Xs is the solution to the FSDE
dXs = µ(Xs )ds + σ(Xs )dωs , Xt = x.
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 2 / 51 HJB equation, dynamic programming
Suppose we consider the Hamilton-Jacobi-Bellman (HJB) equation: ∂v(t, x) 1 + sup{µ0(x, a)Dv(t, x) + Tr[D2v(t, x)σσ0(x, a)] ∂t a∈A 2 + g(t, x, a)} = 0, v(T , x) = h(x).
It is associated to a stochastic control problem with value function Z T x α α v(t, x) = sup Et g(s, Xs , αs )ds + h(XT ) , α t
where Xs is the solution to the controlled FSDE
α α α α dXs = µ(Xs , αs )ds + σ(Xs , αs )dωs , Xt = x.
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 3 / 51 Semilinear PDE and BSDEs
The semilinear partial differential equation: ∂v(t, x) + Lv(t, x) + g(t, x, v, σ(x)Dv(t, x)) = 0, v(T , x) = h(x). ∂t
We can solve this PDE by means of the FSDE:
dXs = µ(Xs )ds + σ(Xs )dωs , Xt = x.
and the BSDE:
dYs = −g(s, Xs , Ys , Zs )ds + Zs dωs , YT = h(XT ).
Theorem: Yt = v(t, Xt ), Zt = σ(Xt )Dv(t, Xt ). is the solution to the BSDE.
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 4 / 51 You can buy insurance against falling stock prices. This is the standard put option (i.e. the right to sell stock at a future time point). The uncertainty is in the stock prices.
Application
Suppose you have stocks of a company, and you’d like to have cash in two years (to buy a house). You wish at least K euros for your stocks, but the stocks may drop in the coming years. How to assure K euros in two years?
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 5 / 51 The uncertainty is in the stock prices.
Application
Suppose you have stocks of a company, and you’d like to have cash in two years (to buy a house). You wish at least K euros for your stocks, but the stocks may drop in the coming years. How to assure K euros in two years? You can buy insurance against falling stock prices. This is the standard put option (i.e. the right to sell stock at a future time point).
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 5 / 51 Application
Suppose you have stocks of a company, and you’d like to have cash in two years (to buy a house). You wish at least K euros for your stocks, but the stocks may drop in the coming years. How to assure K euros in two years? You can buy insurance against falling stock prices. This is the standard put option (i.e. the right to sell stock at a future time point). The uncertainty is in the stock prices.
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 5 / 51 v(T , S) = max(K − ST , 0) =: h(ST )
Financial derivatives Call options
A call option gives the holder the right to trade in the future at a previously agreed strike price, K. s s0 K
0 0 t T
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 6 / 51 Financial derivatives Call options
A call option gives the holder the right to trade in the future at a previously agreed strike price, K. s s0 K
0 0 t T
v(T , S) = max(K − ST , 0) =: h(ST )
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 6 / 51 Feynman-Kac Theorem (option pricing context)
Given the final condition problem
2 ∂v + 1σ2S2 ∂ v + rS ∂v − rv = 0, ∂t 2 ∂S2 ∂S v(T , S)= h(ST ) = given
Then the value, v(t, S), is the unique solution of
−r(T −t) Q v(t, S) = e E {v(T , ST )|Ft }
with the sum of first derivatives square integrable, and S = St satisfies the system of SDEs:
Q dSt = rSt dt + σSt dωt ,
Similar relations also hold for (multi-D) SDEs and PDEs!
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 7 / 51 A pricing approach; European options
−r(T −t0) Q v(t0, S0) = e E {v(T , ST )|F0}
Quadrature: Z −r(T −t0) v(t0, S0) = e v(T , ST )f (ST , S0)dST R
Trans. PDF, f (ST , S0), typically not available, but the characteristic function, fb, often is.
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 8 / 51 Banks sell insurance against changing FX rates. The option pays out in the best currency each year. Uncertain processes are the exchange rates, interest rate, but also the counterparty of the contract may go bankrupt!
Application
A firm will have some business in America for several years. Investment may be in euros, and payment in the local currency. Firm’s profit can be influenced negatively by the exchange rate.
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 9 / 51 but also the counterparty of the contract may go bankrupt!
Application
A firm will have some business in America for several years. Investment may be in euros, and payment in the local currency. Firm’s profit can be influenced negatively by the exchange rate. Banks sell insurance against changing FX rates. The option pays out in the best currency each year. Uncertain processes are the exchange rates, interest rate,
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 9 / 51 Application
A firm will have some business in America for several years. Investment may be in euros, and payment in the local currency. Firm’s profit can be influenced negatively by the exchange rate. Banks sell insurance against changing FX rates. The option pays out in the best currency each year. Uncertain processes are the exchange rates, interest rate, but also the counterparty of the contract may go bankrupt!
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 9 / 51 Multi-asset options
Multi-asset options belong to the class of exotic options.
v(S, T ) = max(max {S1,..., Sd }T − K, 0) (max call) −r(T −t ) R v(S, t0) = e 0 v(S, T )f (S |S0)dS R T ⇒ High-dimensional integral or a high-D PDE.
s K
0 0 t T
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 10 / 51 Increasing dimensions: Multi-asset options
The problem dimension increases if the option depends on more than one asset Si (multiple sources of uncertainty). If each underlying follows a geometric (lognormal) diffusion process, Each additional asset is represented by an extra dimension in the problem:
d d ∂v 1 X ∂2v X ∂v + [σi σj ρi,j Si Sj ] + [rSi ] − rv = 0 . ∂t 2 ∂Si ∂Sj ∂Si i,j=1 i=1
Required information is the volatility of each asset σi and the correlation between each pair of assets ρi,j .
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 11 / 51 Numerical Pricing Approach
One can apply several numerical techniques to calculate the option price: Numerical integration, Monte Carlo simulation, Numerical solution of the partial-(integro) differential equation Each of these methods has its merits and demerits. Numerical challenges: The problem’s dimensionality Speed of solution methods Early exercise feature (→ free boundary problem)
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 12 / 51 5a. Price the risk related to default (SDE, Opt.) 6. Understand and remove risk (Stoch., Opt., Numer.)
Financial engineering; Work at Banks
Financial engineering, pricing approach: 1. Start with some financial product 2. Model asset prices involved (SDEs) 3. Calibrate the model to market data (Numerics, Opt.) 4. Model product price correspondingly (PDE, Integral) 5. Price the product of interest (Numerics, MC)
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 13 / 51 Financial engineering; Work at Banks
Financial engineering, pricing approach: 1. Start with some financial product 2. Model asset prices involved (SDEs) 3. Calibrate the model to market data (Numerics, Opt.) 4. Model product price correspondingly (PDE, Integral) 5. Price the product of interest (Numerics, MC) 5a. Price the risk related to default (SDE, Opt.) 6. Understand and remove risk (Stoch., Opt., Numer.)
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 13 / 51 Motivation Fourier Methods
A characteristic function of a continuous random variable X , equals the Fourier transform of the density of X . Derive pricing methods that are computationally fast are not restricted to Gaussian-based models should work as long as we have a characteristic function, Z ∞ fb(u; x) = eiux f (x)dx; −∞ (available for L´evyprocesses and also for SDE systems).
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 14 / 51 Class of Affine Jump Diffusion (AJD) processes
Suppose we have given a following system of SDEs:
dXt = µ(Xt )dt + σ(Xt )dωt + dZt ,
For processes in the AJD class drift, volatility, jump intensities and interest rate components are of the affine form, i.e.
n n×n µ(Xt ) = a0 + a1Xt for (a0, a1) ∈ R × R , T n λ(Xt ) = b0 + b1 Xt , for (b0, b1) ∈ R × R , T T n×n n×n×n σ(Xt )σ(Xt ) =( c0)ij + (c1)ij Xt , (c0, c1) ∈ R × R , T n r(Xt ) = r0 + r1 Xt , for (r0, r1) ∈ R × R .
Duffie, Pan, Singleton (2000): For affine jump diffusion processes the discounted characteristic function can be derived!
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 15 / 51 Exponential L´evyProcesses
L´evyprocess {Xt }t≥0: process with stationary, independent increments. Brownian motion and Poisson processes belong to this class, as well jump processes with either finite or infinite activity Asset prices can be modeled by exponential L´evyprocesses small jumps describe the day-to-day ”noise”; big jumps describe large stock price movements. The characteristic function of a L´evyprocess is known:
fb(u; Xt ) = E[exp (iuXt )] = Z 1 2 2 iuy exp (t(iµu − σ u + (e − 1 − iuy1[|y|<1]ν(dy))), 2 R the celebrated L´evy-Khinchineformula.
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 16 / 51 Fourier-Cosine Expansions, COS Method (with Fang Fang)
The COS method: Exponential convergence; Greeks (derivatives) are obtained at no additional cost. All based on the availability of a characteristic function. The basic idea: Replace the density by its Fourier-cosine series expansion; Coefficients have simple relation to characteristic function.
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 17 / 51 R iux Fn has direct relation to the ChF, f (u) := f (x)e dx b R ( R f (x) ≈ 0), R\[a,b] 2 Z x − a Fn ≈ Pn := f (x) cos nπ dx b − a R b − a 2 nπ naπ = < fb exp −i . b − a b − a b − a
Series Coefficients of the Density and the ChF
Fourier-Cosine expansion of density function on interval[ a, b]: ∞ X0 x − a f (x) = F cos nπ , n b − a n=0 with x ∈ [a, b] ⊂ R and the coefficients defined as 2 Z b x − a Fn := f (x) cos nπ dx. b − a a b − a
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 18 / 51 Series Coefficients of the Density and the ChF
Fourier-Cosine expansion of density function on interval[ a, b]: ∞ X0 x − a f (x) = F cos nπ , n b − a n=0 with x ∈ [a, b] ⊂ R and the coefficients defined as 2 Z b x − a Fn := f (x) cos nπ dx. b − a a b − a
R iux Fn has direct relation to the ChF, f (u) := f (x)e dx b R ( R f (x) ≈ 0), R\[a,b] 2 Z x − a Fn ≈ Pn := f (x) cos nπ dx b − a R b − a 2 nπ naπ = < fb exp −i . b − a b − a b − a
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 18 / 51 Recovering Densities
Replace Fn by Pn, and truncate the summation:
2 X0N−1 nπ −a x − a f (x) ≈ < fb( ) exp (inπ ) cos(nπ ). b − a n=0 b − a b − a b − a
1 − 1 x2 Example: f (x) = √ e 2 ,[ a, b] = [−10, 10] and 2π x = {−5, −4, ··· , 4, 5}. N 4 8 16 32 64 error 0.2538 0.1075 0.0072 4.04e-07 3.33e-16 cpu time (sec.) 0.0025 0.0028 0.0025 0.0031 0.0032 Exponential error convergence in N.
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 19 / 51 Pricing European Options
Start from the risk-neutral valuation formula: Z −r∆t Q −r∆t v(t0, x) = e E [v(T , y)|F0] = e v(T , y)f (y, x)dy. R
Truncate the integration range: Z −r∆t v(t0, x) = e v(T , y)f (y, x)dy + ε. [a,b]
Replace the density by the COS approximation, and interchange summation and integration:
N−1 −r∆t X0 nπ −inπ a vˆ(t0, x) = e < fb ; x e b−a Hn, b − a n=0
where the series coefficients of the payoff, Hn, are analytic.
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 20 / 51 Pricing European Options
Log-asset prices: x := log(S0/K) and y := log(ST /K). The payoff for European call options reads v(T , y) ≡ max (K(ey − 1), 0).
For a call option, we obtain Z b call 2 y y − a Hk = K(e − 1) cos kπ dy b − a 0 b − a 2 = K (χ (0, b) − ψ (0, b)) . b − a k k
For a vanilla put, we find 2 Hput = K (−χ (a, 0) + ψ (a, 0)) . k b − a k k
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 21 / 51 Results, Heston stochastic volatility PDE
∂v 1 ∂2v ∂2v 1 ∂v ∂v ∂v = S2y + ργSy + γ2y + rS + κ(σ − y) − rv. ∂t 2 ∂S2 ∂S∂y 2 ∂y 2 ∂S ∂y
GPU computing: Multiple strikes for parallelism, 21 IC’s. Heston model N 64 128 256 msec 3.850890 7.703350 15.556240 MATLAB max.abs.err 6.0991e-04 2.7601e-08 < 10−14 GPU msec 0.177860 0.209093 0.333786 Table 1: Maximum absolute error when pricing a vector of 21 strikes.
Exponential convergence, Error analysis in our papers. Also work with wavelets instead of cosines.
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 22 / 51 SWIFT Wavelet Option Pricing (with Luis Ortiz)
Approximate density f by a finite combination of Shannon scaling functions and recovering the coefficients from its Fourier transform.
sin(π(2mx − k)) ϕ (x) = 2m/2 , k ∈ . (1) m,k π(2mx − k) Z For m = k = 0, we have the father wavelet, sin(πx) ϕ(x) = sinc(x) = . πx Wavelets can be moved (by k), stretched or compressed (by m) to accurately represent local properties of a function. Shannon wavelets have a slow decay in the time domain but a very sharp compact support in the frequency (Fourier) domain.
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 23 / 51 Using the classical Vieta formula, the cardinal sine can be approximated:
J 2J−1 Y πt 1 X 2j − 1 sinc(t) ≈ cos = cos πt . (2) 2j 2J−1 2J j=1 j=1
Following the wavelets theory, function f can be approximated at a level of resolution m, i.e.,
k X X2 f (x) ≈ Pmf (x) = cm,k ϕm,k (x) ≈ fm(x) := cm,k ϕm,k (x), (3) k∈Z k=k1 for certain accurately chosen values k1 and k2.
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 24 / 51 Summary
Z v(x, t) = e−r(T −t) v(y, T )f (y|x) dy, R
k X2 f (y|x) ≈ cm,k (x)ϕm,k (y),
k=k1 With: c = hf , ϕ i = R f (x)ϕ(2mx − k)dx. m,k m,k R
2J−1 2m/2 X Z 2j − 1 c ≈ c∗ := f (x) cos π(2mx − k) dx. (4) m,k m,k 2J−1 2J j=1 R or: 2J−1 m/2 m ikπ(2j−1) ∗ 2 X (2j − 1)π2 c ≈ c = < fˆ e 2J . (5) m,k m,k 2J−1 2J j=1
Kees Oosterlee (CWI, TU Delft) Comp. Finance AANMPDE-9-16 25 / 51 Example: Fat-tailed densities:
We can control density values and the mass as a byproduct. h h m X m f ≈ P f = 2 2 c δ = 2 2 c , (6) 2m m 2m m,k k,h m,h k∈Z ...plus... 1 cm,k1 X cm,k2 A = + cm,k + , (7) 2m/2 2 2 k1