-
Notifications
You must be signed in to change notification settings - Fork 146
Description
Hello, I am writing with a small suggestion regarding the Qiskit Tutorial: 03 European Call Option Pricing.
I have noticed that inside this notebook the exact price of the European Call option is computed from:
exact_value = np.dot(uncertainty_model.probabilities, y)
and is given as "Exact value: 0.1623", which compares with the estimate from the IQAE "Estimated value: 0.1708".
However, I would like to suggest to refer to this price as an numerical approximation because it depends on the number of qubits used to discretize the uncertainty model.
In fact, via the Black Scholes model (1973), we have the analytical exact price of a European Call Option (please see below).
With the same parameters, the Black Scholes price is 0.169695, which is in fact much closer to the IQAE estimate of 0.1708.
Kindly find the formulas below, as well as a short python code implementing the Black Scholes Call and Put formulas.
I hope this proves useful.
With best wishes,
Alonso
............... BS Python code ...............
"""
Black-Scholes Option Model: Call & Put
[email protected]
bs_call(S,K,T,r,sigma)
Example:
bs_call(2,1.896,40/365,0.05,0.4)
0.16969509974913577
"""
from math import sqrt, log, pi, exp
from scipy.stats import norm
def bs_call(S,K,T,r,sigma):
d1 = (log(S/K)+(r+sigmasigma/2.)T)/(sigmasqrt(T))
d2 = d1-sigmasqrt(T)
return Snorm.cdf(d1)-Kexp(-r*T)*norm.cdf(d2)
def bs_put(S,K,T,r,sigma):
d1 = (log(S/K)+(r+sigmasigma/2.)T)/(sigmasqrt(T))
d2 = d1-sigmasqrt(T)
return Kexp(-rT)norm.cdf(-d2)-Snorm.cdf(-d1)