Skip to content
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

Open
alonso-pena opened this issue Jun 30, 2021 · 2 comments
Open

03_european_call_option_pricing: adding Black Scholes formulas #65

alonso-pena opened this issue Jun 30, 2021 · 2 comments
Assignees

Comments

@alonso-pena
Copy link

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-sigma
sqrt(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-sigma
sqrt(T)
return Kexp(-rT)norm.cdf(-d2)-Snorm.cdf(-d1)

PLEASE SEE BELOW FOR FORMULAS:

BS formulas.docx

@Cryoris
Copy link
Contributor

Cryoris commented Oct 21, 2021

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.

@alonso-pena
Copy link
Author

alonso-pena commented Oct 21, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants