A TemporalData object can host multiple paths or it can admit a ValueDimensions option value greater than unity.

In the former case, using the Values property of the TemporalData object, produces a list of paths -each list represents a different path- while in the later case, one obtains a single path, but, instead of a single value per time instance (t) in this case, one obtains a list or vector per t.

To make the issue more concrete, consider having $T$ observations. In the former case (many paths, single ValueDimensions), with a number of $k$ paths, the data in the TemporaData object have dimensions $k\times T$.

On the other hand, in the later case, setting a ValueDimensions value equal to d, yields an underlying data structure with dimensions $T\times d$.

On a first glance there seems to be little in common between the two representation. Consider now what would be the case if it so happened that d=k. In such a case, it would seem, that the former data representation is the Transpose of the later (or viceversa). With that occurrence in mind, my question is about making the most out of the TemporalData functionality.

What are some guiding lines on how to represent data using TemporalData objects? When the time stamps of the values are the same for all paths, aren't the two representations discussed above, equivalent?

Is there a use case where the two representations are not equivalent (for common time stamps between paths)? Has anyone dealt with situations where either of the approaches is strongly preferred to the other ?


1 Answer 1


The answer is: it is a matter of definition. Please note that the properties will very much differ depending on the approach - one observation of vector data or multiple observations of univariate data. Only TemporalData supports multipath option. For a single path one can also use TimeSeries. The main difference then is that value at a given time stamp is a vector for single path vector time series and a DataDistribution for a multipath TemporalData. In terms of storage both approaches will attempt to store the values as a packed array, but will exhibit different behaviour under processing functions. So in my opinion the choice boils down on what one wants to be returned at a given time stamp: a value or DataDistribution. ResamplingMethod can be set in either case to override the default.

With TemporalData:

enter image description here

With TimeSeries:

In[336]:= ts = TimeSeries[Transpose[{vals1, vals2}], {0}];

In[337]:= {ts["ValueDimensions"], ts["PathCount"]}

Out[337]= {2, 1}

In[338]:= ts[.2]

Out[338]= {1.2, 0.8 (a - b) + b}

ts0 = TimeSeries[Transpose[{vals1, vals2}], {0}, 
   ResamplingMethod -> {"Interpolation", InterpolationOrder -> 0}];

In[340]:= ts0[.2]

Out[340]= {1, a}

I hope this is helpful. I will be happy to discuss more if needed.

  • 1
    $\begingroup$ thank you for your response; I apologize for the not so short follow-up: what would be an appropriate way for estimating something like a vector autoregression over a rolling window? my go-to sol for the time being is MovingMap over a TemporalData object with ValueDimensions->n where n is the number of series involved. I used to have some issues with TimeSeries that's why I opted for the alternative of using TemporalData; I was wondering if there are faster/more efficient ways of doing something like that? $\endgroup$ Commented Mar 6, 2019 at 14:14
  • $\begingroup$ I am sorry, but I do not understand what your objective is... $\endgroup$
    – Gosia
    Commented Mar 7, 2019 at 18:25
  • 1
    $\begingroup$ I am asking about optimal/suggested ways to implement and estimate VAR's on a rolling window over the data; I apologise for cramming this in a comment; perhaps I'll collect my notes and formulate a proper question when I have time; thank you very much for taking the time to answer $\endgroup$ Commented Mar 8, 2019 at 18:38
  • $\begingroup$ If you are working with VAR, then I think data should be stored as vectors, so one can compute correlation matrices... This is how vector ARProcess is estimated using EstimatedProcess - from vector data (TemporalData with vector values). $\endgroup$
    – Gosia
    Commented Mar 8, 2019 at 22:30

Your Answer

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

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