Twofold problem with Maxima: derivative of cdf_normal and expressing result as an expression of a var...



Hello Raymond,

Thanks for your reply.

I assume I should get pdf_normal in the result because I understand the pdf
is the derivative of cdf and also because it appears in the result of the
theta in the following table (click on the link and see the theta for a
call):
http://en.wikipedia.org/wiki/Black%E2%80%93Scholes#Greeks

As far as d1 and d2 are concerned I am going to have a look at the depends
function you pointed out in order to understand it properly.

Please keep me posted about the cdf/pdf.  I'll let you know about if the
depends helped.

Thanks again!!

Julien.


2009/10/29 Raymond Toy <raymond.toy at stericsson.com>

> Julien Martin wrote:
> > Hello,
> >
> > I am trying to use Maxima in order to compute a partial derivative of
> > the C(S,t) function below
> >
> > d1:(log(S/K)+(r+sigma^2/2)*(T-t))/(sigma*sqrt(T-t))
> > d2:d1-(sigma*sqrt(T-t))
> >
> > C(S,t):=S*cdf_normal(d1,0,1) - K*exp(-r*(T-t))*cdf_normal(d2,0,1)
> >
> > -diff(C(S,t),t)
> >
> > For you information I am in reference to the Black and Scholes
> > formula: http://en.wikipedia.org/wiki/Black%E2%80%93Scholes#Greeks and
> > I am trying to compute the Theta.
> >
> > The problem is that this does not give me the expected result because
> > I would like for the result be expressed as an expression of d1, d2.
> > How can I achieve that??
> >
> > Morevoer, I should get  a pdf_distrib (derivative of cdf_distrib)
> > somewhere in the result.
> Why do you think you should get a pdf_distrib in the result?  The
> derivative of the cdf_normal is easily expressed as an exponential
> function, and that's what maxima does.
>
> Perhaps, you want something like:
>
> C(S,t):=S*cdf_normal(nd1,0,1) - K*exp(-r*(T-t))*cdf_normal(nd2,0,1)
> depends(nd1, t, nd2, t)
>
>
> diff(C(S,t),t)
>
> This will give you an expression in term of nd1, nd2, and the
> derivatives of nd1 and nd2.
>
> Ray
>
>