1
$\begingroup$

I see that I can create time varying 1d data with e.g.

SeedRandom[1]; 

mu = 0.3; 
sigma = 0.5; 
theta = 0.4; 

ntimes = 1000; 
x = RandomFunction[
       OrnsteinUhlenbeckProcess[mu, sigma, theta], {1/ntimes, 1, 1/ntimes}
    ];

time = Range@ntimes; xt = Transpose[{time, x[[2, 1, 1]]}]; 

ListLinePlot[xt, ImageSize -> Medium, Frame -> True, FrameLabel -> {"time", "x"}]

enter image description here

How can I create 2d coordinates (data) that are varying with time using OrnsteinUhlenbeckProcess?

To plot the 2d trajectory I would use:

ListLinePlot[data, ImageSize -> Medium, Frame -> True, 
   FrameLabel -> {"y", "x"}, AspectRatio -> Automatic]
$\endgroup$
1
$\begingroup$

I think I found a solution. I would be happy if somebody could verify it.

SeedRandom[1];

mu = 0.3; 
sigma = 0.5; 
theta = 0.4;

ntimes = 1000;

xy = RandomFunction[
      OrnsteinUhlenbeckProcess[mu, sigma, theta], {1/ntimes, 1, 1/ntimes}, 2][[2]];

data = Transpose[{xy[[1, 1, All]], xy[[1, 2, All]]}];

ListLinePlot[data, ImageSize -> Medium, Frame -> True, 
  FrameLabel -> {"x", "y"}, AspectRatio -> Automatic]

enter image description here

$\endgroup$
  • $\begingroup$ this seems correct; the documentation shows a similar example but with a WienerProcess[] $\endgroup$ – Michael Curry Jun 16 '17 at 18:43

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.