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: Raymond Toy
Date: Thu, 29 Oct 2009 13:46:44 -0400
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