TemporalData

TemporalData[{v1,v2,},tspec]
represents temporal data with values at times specified by tspec.

TemporalData[{{v11,v12,},{v21,v22,},},tspec]
represents a temporal data collection with values at times specified by tspec.

TemporalData[{{t1,v1},{t2,v2}}]
represents temporal data specified by time-value pairs .

TemporalData[{{{t11,v11},{t12,v12}},{{t21,v21},{t22,v22},},}]
represents a temporal data collection given as lists of time-value pairs .

Details and OptionsDetails and Options

  • TemporalData represents a collection of paths composed of time-value pairs .
  • The values can be scalars or arrays of any dimension, but must all be of equal dimensionality.
  • The following times tspec can be given:
  • Automaticuse uniformly spaced times starting at 0
    {tmin}use uniformly spaced times starting at
    {tmin,tmax}use uniformly spaced times to
    {tmin,tmax,dt}use times to in steps of dt
    {{t1,t2,}}use explicit times
    {tspec1,tspec2,}use different times for each path in the collection
  • The can be numbers or any valid input to AbsoluteTime.
  • The values , , and dt can be given as numbers, dates, or Automatic.
  • TemporalData objects of equal dimensionality can be combined into a single object using TemporalData[{td1,td2,}].
  • Normal[td] returns a list containing time-value pairs for each path.
  • Specifying gives the empirical slice distribution at time t.
  • A joint empirical slice distribution for times can be obtained by specifying .
  • Properties of a TemporalData object td can be obtained from td["property"].
  • A list of available properties can be obtained using td["Properties"].
  • Some properties of the collection of paths:
  • "Components"split the collection into individual components
    "PathCount"the number of paths in the collection
    "PathLengths"a list containing the length of each path
    "Paths"a list containing time-value pairs for each path
    "TimeList"a list containing times for each path
    "ValueDimensions"the dimensionality of the values
    "ValueList"a list containing values for each path
  • If dates are given as input, td["Times"] returns them in AbsoluteTime.
  • Some properties for obtaining parts of the collection:
  • "Part"a subset of the original data
    "Path"time-value pairs for a given path
    "PathFunction"an interpolated path function
    "Values"values for a given path
    "Times"times for a given path
    "SliceData"a slice through all paths at a given time
    "SliceDistribution"empirical distribution of slice data at a given time
  • Specifying gives the time-value pairs for the paths specified by p, where p can be any valid Part specification.
  • The property returns interpolated paths specified by p.
  • Specifying gives TemporalData for paths specified by p and times specified by tspec. If necessary, the paths are resampled according to .
  • Giving returns a slice through all paths at time t, where t can be a number or valid input to AbsoluteTime.
  • The specification gives a multivariate slice at times .
  • TemporalData takes the following options:
  • CalendarType"Gregorian"the calendar type to use
    HolidayCalendar{"UnitedStates","Default"}the holiday calendar to use
    MetaInformationNoneinclude additional meta-information
    MissingDataMethodNonemethod to use for missing values
    ResamplingMethod"Interpolation"the method to use for resampling paths
    ValueDimensionsAutomaticthe dimensions of the values
    TemporalRegularityAutomaticwhether to assume the data is regular
  • By default, zero-order interpolation is used for resampling paths. The setting ResamplingMethod->{"Interpolation",opts} can be given, where opts are options passed to Interpolation.
  • The setting ValueDimensions->dim specifies that the values are of dimension dim. Setting ValueDimensions->Automatic attempts to automatically determine the dimension of the values from the data.
  • Setting the MissingDataMethod->Automatic will automatically interpolate values with head Missing, according to the ResamplingMethod setting. By default, values with head Missing are treated as missing.

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Attach temporal information to some values:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Visualize the path:

In[3]:=
Click for copyable input
Out[3]=

Create a collection of paths with equivalent times:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Visualize the collection:

In[3]:=
Click for copyable input
Out[3]=

Compute the Mean and StandardDeviation at time :

In[4]:=
Click for copyable input
Out[4]=
In[5]:=
Click for copyable input
Out[5]=

Use dates as time stamps:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input

Plot the financial time series with DateListPlot:

In[3]:=
Click for copyable input
Out[3]=

The value of both stocks on May 24, 2009:

In[4]:=
Click for copyable input
Out[4]=

The average value of each stock over the date range:

In[5]:=
Click for copyable input
Out[5]=
Introduced in 2012
(9.0)
| Updated in 2014
(10.0)