[Tutor] How to calculate the cumulative normal distribution
Oscar Benjamin
oscar.j.benjamin at gmail.com
Fri Oct 2 22:39:35 CEST 2015
On Wed, 30 Sep 2015 10:14 Laura Creighton <lac at openend.se> wrote:
In a message of Wed, 30 Sep 2015 09:12:20 +0300, Michel Guirguis writes:
>Good afternoon,
>
>How to calculate the cumulative normal distribution function CND in order
to use this figure to calculate the call option based on the Black and
Scholes model.
The easy way is to install scipy
Michel, It sounds like you probably do want to install scipy for the work
that you're doing and Laura's correct that anaconda is the easiest way to
do that.
However I want to point out that your specific problem is easily solved
with the stdlib. The CDF of the standard normal distribution is easily
expressed in terms of the error function erf which is available in the math
module:
fron math import erf
def phi(z):
return 0.5 * (1 + erf(z))
--
Oscar
More information about the Tutor
mailing list