Twofold problem with Maxima: derivative of cdf_normal and expressing result as an expression of a var...
Subject: Twofold problem with Maxima: derivative of cdf_normal and expressing result as an expression of a var...
From: Julien Martin
Date: Thu, 29 Oct 2009 18:57:04 +0100
Raymond,
What I want to do is for maxima to take into account d1 and d2 in their
expanded form when I compute the derivative, and then to try and express the
result of the derivation in term and of d1 and d2 (I am not sure about the
mathematical term I should use in this sentence).
As far as cdf and pdf are concerned, it is basically the same idea.
Julien.
2009/10/29 Raymond Toy <raymond.toy at stericsson.com>
> Julien Martin wrote:
> > Hello again,
> > No luck with "depends".
> > Since I have defined d1 and d2 above, when I input:
> > depends(d1, t, d2, t)
> > it tells me "the arguments to depends must be a symbolic name".
> >
> > Here is all that I input in the same order:
> >
> > load(distrib)
> > 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)
> > depends(d1, t, d2, t)
> You want diff(C(S,t),t) in terms of d1 and d2. Then don't define d1 in
> terms of t. When you do that, C(S,t) has d1 expanded out, so you lose
> that dependency. If you look at the example I gave, I used nd1 and nd2
> so as not to conflict with your d1, d2.
>
> If you don't want the derivative of cdf_normal to be expressed as an
> exponential, use, say cdf. You can then tell maxima that the derivative
> of cdf is pdf. (I've forgotten how to do that.)
>
> Ray
>
>