3
$\begingroup$

I have defined an Ito Process such that:

SeedRandom[1234];
proc = ItoProcess[{\[DifferentialD]X[t] == (w + k*Sin[Y[t] - X[t]])*\[DifferentialD]t + s*\[DifferentialD]W[t],
                   \[DifferentialD]Y[t] == (w + k*Sin[X[t] - Y[t]])*\[DifferentialD]t + s*\[DifferentialD]W[t]},
                  {X[t], Y[t]}, {{X, Y}, {X0, Y0}},
                  t, W \[Distributed] WienerProcess[]];
proc1 = proc /. {X0 -> 1, Y0 -> 0, k -> 1, w -> 1, s -> 0.01};
sample = RandomFunction[proc1, {0, 100, 0.01}]

and I would like to study the difference and ratios between the variables X and Y. I have spent some time searching through the RandomFunction documentation and resulting sample variable, however I haven't been able to find how to isolate a single variable. I can plot both at the same time using

ListLinePlot[sample]

but not just X or Y. It seems as though sample[[2]] is where the data is stored, but the format and how to isolate it is unclear to me even after spending time with the documentation.

$\endgroup$
2
  • 3
    $\begingroup$ Does sample["PathComponents"] do what you want? $\endgroup$ Jul 18, 2022 at 17:07
  • $\begingroup$ @J.M. That is exactly what I am looking for! Thank you so much for your clarifying edits and answer :) $\endgroup$
    – Cameron F.
    Jul 18, 2022 at 17:09

1 Answer 1

5
$\begingroup$

As J.M. stated in the comments, sample["PathComponents"] allows me to isolate the variables.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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