Reputation: 175
I am doing Ito calculus workings in Maple. With B__t
as a standard Brownian motion, the following results are true:
dB__t*dt = 0;
dB__t^2 = dt;
dt^2 = 0;
Now when I want to do the assignment:
dB__t*dt := 0;
dB__t^2 := dt;
dt^2 := 0;
I get the error message Error, illegal use of an object as a name
. Why the need of the above assignments? Suppose I have:
Y__t := ln(1/X__t - 1);
dX__t := 0.5*X__t(-X__t + 1)*(-2*X__t + 1)*dt - X__t*(-X__t + 1)*dB__t;
Applying Ito's lemma on Y__t
:
dY__t := diff(Y__t, t)*dt + diff(Y__t, X__t)*dX__t + 0.5*diff(Y__t, X__t, X__t)*dX__t^2
and expanding and simplying using:
dY__t := simplify(expand(dY__t))
Now that I have an expanded dY__t
expression, I want to then replace dt*dB__t
, dB__t*dt
and dt^2
with zero and to replace dB__t^2
with dt
. How do I do that?
Upvotes: 1
Views: 105
Reputation: 7271
Here are two ways to make such substitutions (with simplifications as one goes),
restart;
Y__t:=ln(1/X__t-1):
dX__t:=1/2*X__t*(-X__t+1)*(-2*X__t+1)*dt-X__t*(-X__t+1)*dB__t:
dY__t:= diff(Y__t,t)*dt + diff(Y__t,X__t)*dX__t+diff(Y__t,X__t,X__t)*dX__t^2:
First way,
simplify(dY__t,{dB__t*dt=0});
simplify(%,{dB__t^2=dt});
simplify(%,{dt^2=0});
Second way,
simplify(algsubs(dB__t*dt=0,expand(dY__t)));
simplify(algsubs(dB__t^2=dt,%));
simplify(algsubs(dt^2=0,%));
Upvotes: 1