Newbie in stochastic differential equations

You might want to take a look at the stochastic differential equation tutorial. Specifically, this one shows how to solve with scalar noise terms:

http://docs.juliadiffeq.org/latest/tutorials/sde_example/#Example-3:-Systems-of-SDEs-with-Scalar-Noise-1

For your case, you’d do:

function f(du,u,p,t)
  du[1] = 1
  du[2] = u[1]
end

function g(du,u,p,t)
  du[1] = -1
  du[2] = 1
end

since du = f*dt + g*dW where we now make W scalar:

W = WienerProcess(0.0,0.0,0.0)
prob = SDEProblem(f,g,u0,(0.0,1.0),noise=W)
sol = solve(prob,SRIW1())

Take a look at this part of the tutorial:

http://docs.juliadiffeq.org/latest/tutorials/sde_example/#Ensemble-Simulations-1

Other documentation on ensemble simulations describes more about generating other averages.

1 Like