#14671: Adding Black-Scholes to Sage finance
---------------------------------------------------+------------------------
Reporter: Zaxis | Owner: Zaxis
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-5.11
Component: finance | Resolution:
Keywords: Black-Scholes, finance, options | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Brian Manion | Merged in:
Dependencies: | Stopgaps:
---------------------------------------------------+------------------------
Comment (by Zaxis):
Replying to [comment:3 was]:
> - give a reference for the formula you're using
I'm using the Black-Scholes formula from a textbook called Stochastic
Calculus for Finance II, by Steven Shreve, which is equivalent to the one
found on wikipedia.
http://en.wikipedia.org/wiki/Black%E2%80%93Scholes#Black.E2.80.93Scholes_formula
\\\\
> - are there generalizations you plan to implement later?
Could you elaborate just a little more on this? I do plan on implementing
functionality that allows for using different underlying distributions.
\\\\
> - why should somebody believe the examples you give? Are they
> replicating some examples elsewhere (e.g., on a wikipedia page)?
Unfortunately there aren't any good verifiable examples on the internet.
Also the online calculators are neither precise nor accurate. So I will
present to you a few screen-shots of examples and we'll compare it to the
results of the black_scholes function presented in the patch. One is from
a textbook and the other is from the matlab documentation; Both showcase
the Matlab Black-Scholes function (called blsprice). I think this will
show that my examples are precise to at least 4 digits to the right of the
decimal point (in the best case).
\\\\
== Example 1: From ''MATLAB with Applications to Engineering, Physics and
Finance''; by David Baez-Lope ==
[[Image(https://dl.dropboxusercontent.com/u/66800298/Trac_14671_Example_1.png)]]
\\
Let's compare with black_scholes:
{{{
sage: finance.black_scholes(42, 40, 0.5, 0.1, 0.2, 'call')
4.759422392871532
sage: finance.black_scholes(42, 40, 0.5, 0.1, 0.2, 'put')
0.8085993729000958
}}}
\\\\
== Example 2: From the Matlab documentation ==
http://www.mathworks.com/help/finance/blsprice.html
[[Image(https://dl.dropboxusercontent.com/u/66800298/Trac_14671_Example_2.png)]]
\\
Let's compare with black_scholes:
{{{
sage: finance.black_scholes(100, 95, 0.25, 0.1, 0.5, 'call')
13.695272738608132
sage: finance.black_scholes(100, 95, 0.25, 0.1, 0.5, 'put')
6.349714381299734
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14671#comment:8>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.