2

I have two Ito processes as shown below. I can define them separately, and simulate and plot them separately. The thing is, I do not want to apply RandomFunction to proc1 and proc2 separately. Because I need the same exact random Wiener values generated for proc1, to be applied to the Wiener in proc2. I guess I first need to “combine” these proc1 and proc2 processes into one ItoProcess command. Then somehow I need to apply RandomFunction to this combined command. Any hints on how to do it? I could not figure out how to list two or more processes in one ItoProcess command to begin with. Many thanks. P.S. time goes from 0 to 5 in 0.01 increment.

proc1 = ItoProcess[\[DifferentialD]w[t] == Sin[t]*0.03*w[t] \[DifferentialD]t + 
0.35*(0.4 \[DifferentialD]W[t] + 0.10 \[DifferentialD]t), w[t], {w, 50}, t, W \[Distributed] WienerProcess[]]
proc2 = ItoProcess[\[DifferentialD]b[t] == 0.03*b[t] \[DifferentialD]t + 
0.35*(0.4 \[DifferentialD]Z[t] + 0.10 \[DifferentialD]t) - t^2, b[t], {b, 45}, t, Z \[Distributed] WienerProcess[]]
Alex
  • 35
  • 4
  • Couldn't you just use SeedRandom or BlockRandom to make sure the RNG produces the same values for both processes? – Sjoerd Smit Jan 02 '19 at 22:22
  • Thanks you, I have read about them but frankly have no idea how to put them in a command to achieve what you suggest. Any hint is appreciated. – Alex Jan 02 '19 at 23:57
  • Thank you very much, really appreciate your detailed response. – Alex Jan 03 '19 at 22:08

2 Answers2

2

You could define a vector ItoProcess using only one WienerProcess:

both = ItoProcess[
  {\[DifferentialD]w[t] == Sin[t]*0.03*w[t] \[DifferentialD]t +
                           0.35*(0.4 \[DifferentialD]W[t] + 0.10 \[DifferentialD]t), 
   \[DifferentialD]b[t] == 0.03*b[t] \[DifferentialD]t +  0.35*(0.4 \[DifferentialD]W[t] + 0.10 \[DifferentialD]t) - t^2}, 
  {w[t], b[t]}, {{w, b}, {50, 45}}, {t, 0}, W \[Distributed] WienerProcess[]
      ]

and then use it as

sample = RandomFunction[both, {0, 5, 0.01}, 16]

Show[ListLinePlot /@ sample["PathComponents"], PlotRange -> All, AxesOrigin -> {0, 40}]

enter image description here

b.gates.you.know.what
  • 20,103
  • 2
  • 43
  • 84
2

To elaborate on my comment about using random seeding, the following code should use the same random numbers for the sampling of both processes:

proc1 = ItoProcess[\[DifferentialD]w[t] == 
    Sin[t]*0.03*w[t] \[DifferentialD]t + 
     0.35*(0.4 \[DifferentialD]W[t] + 0.10 \[DifferentialD]t), 
   w[t], {w, 50}, t, W \[Distributed] WienerProcess[]];
proc2 = ItoProcess[\[DifferentialD]b[t] == 
    0.03*b[t] \[DifferentialD]t + 
     0.35*(0.4 \[DifferentialD]Z[t] + 0.10 \[DifferentialD]t) - t^2, 
   b[t], {b, 45}, t, Z \[Distributed] WienerProcess[]];

randomFunctions = Table[
   BlockRandom[
    SeedRandom[1];
    RandomFunction[p, {0, 5, 0.01}, 5]
   ],
   {p, {proc1, proc2}}
];

Show[ListPlot /@ randomFunctions, PlotRange -> All, AxesOrigin -> {0, 40}]
Sjoerd Smit
  • 23,370
  • 46
  • 75