Runge Kunta on SDE
- From: David Langevin <langevin_david@xxxxxxxxxxx>
- Date: Thu, 16 Feb 2006 21:26:49 EST
Dear readers,
I want to apply the Runge Kunta fourth order scheme on the following SDE:
dX = aXdt + bXdW
where a,b are real, dW = sqrt(dt)N(0,1) is a wiener process.
When b=0 in my program all is fine, the solution is the same as in the deterministic case (Hopefully !), the problem I have is in the stochastic part, the scheme doesn't converge to the true solution:
X = X0exp(((a-b^2/2)t+bW)
where X0 is real.
Here is the small program that compute RK4:
function RungeKuntaApprox = RK4(N, M, X0, a, b, dt, dW)
L = (floor(1/dt)); % time step
RungeKuntaApprox = zeros(N*M,(floor(1/dt)));
Xtemp = X0;
for j = 1:L
W = sum(dW(:,1:j),2);
k1 = a*Xtemp*dt + b*Xtemp.*W;
k2 = a*(Xtemp + 0.5*k1)*dt + b*(Xtemp + 0.5*k1).*W;
k3 = a*(Xtemp + 0.5*k2)*dt + b*(Xtemp + 0.5*k2).*W;
k4 = a*(Xtemp + k3)*dt + b*(Xtemp + k3).*W;
Xtemp = Xtemp + 1/6*(k1 + 2*k2 + 2*k3 + k4);
RungeKuntaApprox(:,j) = Xtemp;
end
Thank's for your contribution !
DL
.
- Follow-Ups:
- Re: Runge Kunta on SDE
- From: David Langevin
- Re: Runge Kunta on SDE
- From: Simo Särkkä
- Re: Runge Kunta on SDE
- From: Peter Spellucci
- Re: Runge Kunta on SDE
- Prev by Date: Higher-order root solving. Newton. Halley, Householder, Bernoulli
- Next by Date: Re: Kutta Merson integration
- Previous by thread: Higher-order root solving. Newton. Halley, Householder, Bernoulli
- Next by thread: Re: Runge Kunta on SDE
- Index(es):