-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
03_european_call_option_pricing: adding Black Scholes formulas #65
Comments
Hi @alonso-pena, the "exact value" in the tutorial references to the exact expectation value that QAE approximates. It does not correspond to the true/analytic value of the european call option. Even though we're lucky and IQAE is closer to the analytic value of the option, it's error is actually the difference to the exact expectation value. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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)
PLEASE SEE BELOW FOR FORMULAS:
BS formulas.docx
The text was updated successfully, but these errors were encountered: