I'm a little confused with the TemporalData structure in Mathematica, in the sense that it doesn't seem to behave like a list.

What I'd like to do is plot the sum and difference of a Brownian motion and an OU process, and so far, generating and plotting these individual processes is not a problem:

Z = RandomFunction[WienerProcess[0, 1], {0, 1, 0.01}];

L = RandomFunction[OrnsteinUhlenbeckProcess[0, 1, 1, 0], {0, 1, 0.01}];

ListLinePlot[{Z,L}]


However, plotting their sum with

ListLinePlot[Z+L]


yields an error:

ListLinePlot::lpn: TemporalData[Automatic,{<<1>>}]+TemporalData[Automatic,{<<1>>}]
is not a list of numbers or pairs of numbers.


I've checked out this related post, but am unsure how to interpret it in the context of my particular problem. Is there a simple way to do what I'd like?

• That's because it's not a list (well, it is in the broadest sense, but really it's an object). Try ListLinePlot[First[Z["States"] + L["States"]]] e.g.
– ciao
May 9 '14 at 22:33
• for the sake of completenes, ListPlot[Z + L] works perfectly ok with 11.3 Mar 21 '18 at 10:31

As noted in my comment, constructs like TemporalData are not meant to be treated as vanilla lists (see the documentation for details on getting "pieces" of them via their properties).

In your case, you're interested in the addition of the states over time, so, e.g.:

Z = RandomFunction[WienerProcess[0, 1], {0, 1, 0.01}];

L = RandomFunction[OrnsteinUhlenbeckProcess[0, 1, 1, 0], {0, 1, 0.01}];

ListLinePlot[{Z, L}]

ListLinePlot[First[Z["States"] + L["States"]]]


With the addition of TimeSeriesThread to Mathematica 10 this becomes trivial.

Z = RandomFunction[WienerProcess[0, 1], {0, 1, 0.01}];
L = RandomFunction[OrnsteinUhlenbeckProcess[0, 1, 1, 0], {0, 1, 0.01}];


ListLinePlot[Z+L]

(where the Z and L are defined as in the question) evaluates as expected; there's no need for accessing the "Values" of the underlying TemporalSeries, operating on them and then plotting.