Just as an exercise I'm trying to follow this paper: https://arxiv.org/ftp/arxiv/papers/1502/1502.02963.pdf
In the section 2.2 it calculates the value of a Call using the characteristic function of the underlying under Black-Scholes dynamics.
I'm using Python, and strangely my result seems to be exactly 1/2 of the value of the call option, because both the Pi1 and Pi2 I get are also 1/2 of what is supposed to be.
For instance I'm calculating the value of a call option with parameters:
- S = 100
- K = 10
- t = 1
- vol = 0.2
- r = 0
which should give me a Pi1 (delta) equal to 1 (since it's deep ITM) but instead I get a Pi1 = 0.49999999 and a call value of 44.99999
Could you help to to point out where might I have an error? I really hope is not a silly mistake, I've been trying to figure it out for the last 2-3 hours but I cannot see anything wrong. Here is the code I'm using:
import numpy as np
from scipy import stats, special, integrate
def char_func(x,s,vol,t=1,r=0):
mean = np.log(s) + (r - 0.5*vol*vol) * t
var = vol*vol*t
w = np.exp(1j*x*mean - x*x*vol*vol*0.5)
return w.real
def call_value(s,k,vol,t=1,r=0):
def integrand(x,s,k,vol,t=1,r=0):
I = np.exp(-1j*x*np.log(k)) * char_func(x-1j,s,vol,t,r)/(1j*x*char_func(-1j,s,vol,t,r))
return I.real
def integrand2(x,s,k,vol,t=1,r=0):
I = np.exp(-1j*x*np.log(k)) * char_func(x,s,vol,t,r)/(1j*x)
return I.real
int1 = integrate.quad(integrand,0,np.inf,args=(s,k,vol,t,r))
int1 = 0.5 + int1[0]/np.pi
int2 = integrate.quad(integrand2,0,np.inf,args=(s,k,vol,t,r)))
int2 = 0.5 + int2[0]/np.pi
return s*int1 - np.exp(-r*t)*k*int2
print(call_value(100,10,0.2))
Thanks