Re: Stochastic calculus in Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg34399] Re: [mg34363] Stochastic calculus in Mathematica
- From: Andrzej Kozlowski <andrzej at platon.c.u-tokyo.ac.jp>
- Date: Sat, 18 May 2002 03:51:02 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Presumably Ln means the natural logarithm? Also, you should never use capital I for anything but Sqrt[-1]. If I have understood you correctly the following should be what you are looking for: << "ItosLemma`" In[2]:= {TimeSymbol, TimeIncrement, BrownianIncrement, CorrelationSymbol} = {t, dt, dB, rho} Out[2]= {t, dt, dB, rho} In[3]:= ItoMake[X[t], a*mu1[t], {sigma1, 0}] Out[3]= a dt mu1[t] + sigma1 dB 1 In[4]:= ItoMake[Y[t], b*mu2[t], {0, sigma2}] Out[4]= b dt mu2[t] + sigma2 dB 2 Now assuming you have uncorollated Brownians: In[5]:= Simplify[ItoD[(X[t] - Log[X[t]])*(Y[t] - Log[Y[t]])]] Out[5]= 2 2 1 sigma2 X sigma1 Y - dt (--------- + --------- + 2 2 2 Y X 2 2 b mu2 (-1 + Y) (X - Log[X]) sigma2 Log[X] ----------------------------- - -------------- + Y 2 Y 2 2 a mu1 (-1 + X) (Y - Log[Y]) sigma1 Log[Y] ----------------------------- - --------------) + X 2 X sigma1 (-1 + X) (Y - Log[Y]) dB 1 -------------------------------- + X sigma2 (-1 + Y) (X - Log[X]) dB 2 -------------------------------- Y with corollated ones: In[6]:= Simplify[ItoD[(X[t] - Log[X[t]])*(Y[t] - Log[Y[t]]), OrthogonalBrownians -> False]] Out[6]= 1 2 ------- (2 sigma1 (-1 + X) X Y (Y - Log[Y]) dB + 2 2 1 2 X Y 2 2 sigma2 X (-1 + Y) Y (X - Log[X]) dB + 2 2 3 3 3 2 dt (sigma2 X - 2 b mu2 X Y + 2 b mu2 X Y + 2 3 3 2 3 sigma1 Y - 2 a mu1 X Y + 2 a mu1 X Y - 2 2 X (sigma2 + 2 b mu2 (-1 + Y) Y) Log[X] - 2 2 2 sigma1 Y Log[Y] + 2 a mu1 X Y Log[Y] - 2 2 2 a mu1 X Y Log[Y] + 2 sigma1 sigma2 (-1 + X) X (-1 + Y) Y rho )) 1,2 Andrzej Kozlowski Toyama International University JAPA On Friday, May 17, 2002, at 07:30 PM, Narve wrote: > Hi! > > I have two stochastic processes defined > > as > > dI = a*(mu1(t)-Ln(I))+sigma1*dZ1 > dP=b*(mu2(t)-Ln(P))+sigma2*dZ2 > > where mu1(t) denotes a deterministic function of time, a and b are > constants, sigma1 and sigma2 denotes two constant standard deviations > and dZ1 and dZ2 are two brownian motions. Thus, I have two > mean-reverting processes of the Ln-values of two variables. > > The problem is that I want to multiply the two processes (one is a > volume process, the other a price process) and compute the stochastic > derivative of the resulting expression. I got the ItosLemma notebook off > the web, but cannot figure out how (if) this can be done. Anyone ? > > Cheers, > Narve > > > > N http://platon.c.u-tokyo.ac.jp/andrzej/