Re: Solving for equations with CDF functions
- To: mathgroup at smc.vnet.net
- Subject: [mg67798] Re: Solving for equations with CDF functions
- From: "Valeri Astanoff" <astanoff at yahoo.fr>
- Date: Sat, 8 Jul 2006 04:56:00 -0400 (EDT)
- References: <e8lgau$r6e$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Matt, Given that K is supposed to be not very far from S, here is a first order approximate solution : In[1]:=<< Statistics` In[2]:=normdist = NormalDistribution[0, 1] ; d1 = (Log[(S/K)] + (r + delta + 1/2*sigma^2)*T)/(sigma*Sqrt[T]) ; d2 = d1 - sigma*Sqrt[T] ; price = S*Exp[-delta*T]*CDF[normdist, d1] - K*Exp[-r*T]*CDF[normdist, d2] ; Solve[C == price, K] >From In[2]:= [...] In[3]:=K1=K /. First@Solve[C == (Series[price, {K,S,1}]//Normal),K] //FullSimplify Out[3]=(Sqrt[2]*E^(r*T+((-2*(delta+r)+sigma^2)^2*T)/ (8*sigma^2))*S-Sqrt[2]*E^(delta*T+((2*(delta+r)+sigma^2)^2*T)/ (8*sigma^2))*S-2*C*E^(((2*(delta+r)+sigma^2)^2*T)/ (4*sigma^2))*Sqrt[Pi]*sigma*Sqrt[T]+E^(((4*(delta+r)^2+ 4*r*sigma^2+sigma^4)*T)/(4*sigma^2))*Sqrt[Pi]*S*sigma*Sqrt[T]* (1+Erf[((2*(delta+r)+sigma^2)*Sqrt[T])/(2*Sqrt[2]*sigma)]))/ (Sqrt[2]*(E^(r*T+((-2*(delta+r)+sigma^2)^2*T)/(8*sigma^2))- E^(delta*T+((2*(delta+r)+sigma^2)^2*T)/(8*sigma^2)))+ E^(((4*(delta+r)^2+4*delta*sigma^2+sigma^4)*T)/(4*sigma^2))* Sqrt[Pi]*sigma*Sqrt[T]*(1+Erf[((2*(delta+r)-sigma^2)*Sqrt[T])/ (2*Sqrt[2]*sigma)])) Check example : In[4]:=val={C -> 6, S -> 60, r -> 0.04, delta -> 0, sigma -> 0.3, T -> 0.5}; In[5]:=FindRoot[C == price /. val,{K,50}] Out[5]={K -> 59.2639} In[6]:=K1 /. val Out[6]=59.2467 Not too bad, with that example... V.Astanoff