I want to solve this differential equation $\frac{dy(t)}{dt}=(c+\sigma_w W(t))y(t)+\epsilon(t) $. For details see https://math.stackexchange.com/questions/1385633/solving-sde-fracdytdt-c-sigma-wwtyt-epsilont. My approach is using Mathematica. However, I have not been able to specify this SDE in Mathematica. As far as I understand, the ItoProcess function is appropriate. I have come this far:

proc = 
     {\[DifferentialD]y[t] == c*y[t]\[DifferentialD]t + 
       e[t]*\[DifferentialD]t + σ*y[t]*w[t]}, 
     y[t], {y, y0}, t, Distributed[w, WienerProcess[]]] 

How do I now tell Mathematica that e[t] is a gaussian white noise process, c is a scalar and σ a non-negative scalar?

  • $\begingroup$ Did you try searching the Internet for related problems ? $\endgroup$ – Sektor Aug 7 '15 at 14:01
  • 1
    $\begingroup$ You can format inline code and code blocks by selecting the code and clicking the {} button above the edit window. The edit window help button ? is also useful for learning how to format your questions and answers. You may also find this this meta Q&A helpful $\endgroup$ – Michael E2 Aug 7 '15 at 14:02

Revision to accommodate multiple random processes

One approach is to define e[t] in the question as e*\[DifferentialD]w[t], with e a scale factor.

Then, ItoProcess yields

proc = ItoProcess[{\[DifferentialD]y[t] == c*y[t]*\[DifferentialD]t + σ*y[t]
    *\[DifferentialD]w1[t] + e*\[DifferentialD]w2[t]}, y[t], {y, y0}, t, 
    {w1 \[Distributed] WienerProcess[], w2 \[Distributed] WienerProcess[]}]

or, equivalently,

proc = ItoProcess[{\[DifferentialD]y[t] == y[t]*\[DifferentialD]w1[t] + 
    \[DifferentialD]w2[t]}, y[t], {y, y0}, t, 
    {w1 \[Distributed] WienerProcess[c, σ], w2 \[Distributed] WienerProcess[0, e]}]

(* ItoProcess[{{c y[t]}, {{σ y[t], e}}, y[t]}, {{y}, {y0}}, {t, 0}] *)

A typical result can be obtained by specifying the four parameters.

ans = RandomFunction[proc /. {σ -> 0.1, y0 -> 1, c -> -0.01, e -> 0.1}, {0, 100, .1}];
ListLinePlot[ans, Filling -> Axis, PlotRange -> All, AxesLabel -> {t, y}]

enter image description here

Note that SeedRandom is included only to obtain this particular curve and otherwise is unnecessary.

  • $\begingroup$ If I do this, are the first w[t] and second w[t] then independent or one and the same process? Are you sure that all constants have to be given numerical values? I have examples notebooks where this is not the case and they work just fine. $\endgroup$ – Julian Karch Aug 10 '15 at 13:00
  • $\begingroup$ @JulianKarls You are correct that giving all constants numerical values is not needed to define an ItoProcess but only to obtain numerical results. Also, I have revised the answer above to introduce a second WienerProcess to represent e(t). Thanks for prompting me to be more careful. $\endgroup$ – bbgodfrey Aug 10 '15 at 15:33
  • $\begingroup$ Great, this has solved putting the process into mathematica. Is there a function that gives me the analytic expression for $y(t)$? $\endgroup$ – Julian Karch Aug 10 '15 at 19:13
  • $\begingroup$ @JulianKarls There is no analytic expression for y[t], because it is stochastic. However, you can obtain its average value from Mean[proc[t]], which is E^(c t) y0. If the answer above meets you needs, please do not forget to accept it. Best wishes. $\endgroup$ – bbgodfrey Aug 10 '15 at 20:28
  • $\begingroup$ y[t] being stochastic does not mean that there does not exist an analytic expression for it. The Ornstein-Uhlenbeck process for example is represented by a very similar SDE and there exists an analytic expression for it. $\endgroup$ – Julian Karch Aug 10 '15 at 21:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.