- Joined
- 1/3/19
- Messages
- 1
- Points
- 11
Hi,
I am attempting to implement the following paper:
The pricing of exotic options by Monte-Carlo simulations in a Levy market with stochastic volatility
AU - Schoutens, Wim
AU - Symens, Stijn
DO - 10.1142/S0219024903002249
JO - International Journal of Theoretical and Applied Finance
So far I have found a blog which provides some python code to implement the Carr-Madan formula using the FFT:
I have quickly modified the code to create a simple call function:
Any help with the following would be greatly appreciated:
Thank you for your time.
I am attempting to implement the following paper:
The pricing of exotic options by Monte-Carlo simulations in a Levy market with stochastic volatility
AU - Schoutens, Wim
AU - Symens, Stijn
DO - 10.1142/S0219024903002249
JO - International Journal of Theoretical and Applied Finance
So far I have found a blog which provides some python code to implement the Carr-Madan formula using the FFT:
I have quickly modified the code to create a simple call function:
Code:
import numpy as np
import scipy as sp
import scipy.interpolate
import scipy.stats
def FourierST3(S0,K,sigma,T,r,q,N):
j=complex(0,1)
#create vector in the real space
x_min=-7.5
x_max=7.5
dx=(x_max-x_min)/(N-1)
x=np.linspace(x_min,x_max,N)
#create vector in the fourier space
w_max=np.pi/dx;
dw=2.0*w_max/(N);
w=np.concatenate((np.linspace(0,w_max,N/2+1),np.linspace(-w_max+dw,-dw,N/2-1)))
# Option payoff
s = S0*np.exp(x);
v_call = np.maximum(s-K,0)
# v_put = np.maximum(K-s,0)
# FST method
char_exp_factor = np.exp((j*(r-0.5*sigma**2)*w - 0.5*sigma**2*(w**2)-r)*T) # characteristic function for lognormal density
VC = np.real(np.fft.ifft(np.fft.fft(v_call)*char_exp_factor))
# VP = np.real(np.fft.ifft(np.fft.fft(v_put)*char_exp_factor))
#Interpolate option prices
tck=sp.interpolate.splrep(s,VC)
C=sp.interpolate.splev(S0,tck,der=0)
# tck=sp.interpolate.splrep(s,VP)
# P=sp.interpolate.splev(S0,tck,der=0)
return C
FourierST3(1,1,0.25,1,0.02,0,2**18)
Any help with the following would be greatly appreciated:
- How do we reach the values of x_min and x_max? In the above blog, they are -7.5 and 7.5.
- I assume that in order to price the options we need the three characteristic functions that would replace the variable 'char_exp_factor' : VG-CIR, Meixner-CIR and NIG-CIR. I am confused as to how to compute and hence code these.
Thank you for your time.
Last edited: