# Passing the same random values for two stochastic processes

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[]]

• Couldn't you just use SeedRandom or BlockRandom to make sure the RNG produces the same values for both processes? Jan 2, 2019 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 2, 2019 at 23:57
• Thank you very much, really appreciate your detailed response.
– Alex
Jan 3, 2019 at 22:08

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}]


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}]