# TemporalData

TemporalData[{v1,v2,},tspec]

represents temporal data with values vi at times specified by tspec.

TemporalData[{{v11,v12,},{v21,v22,},},tspec]

represents a temporal data collection with values vij at times specified by tspec.

TemporalData[{{t1,v1},{t2,v2}}]

represents temporal data specified by time-value pairs {ti,vi}.

TemporalData[{{{t11,v11},{t12,v12}},{{t21,v21},{t22,v22},},}]

represents a temporal data collection given as lists of time-value pairs {tij,vij}.

# Details and Options

• TemporalData represents a collection of paths composed of time-value pairs {tij,vij}.
• The values vij can be scalars or arrays of any dimension, but must all be of equal dimensionality.
• The following times tspec can be given:
•  Automatic use uniformly spaced times starting at 0 {tmin} use uniformly spaced times starting at tmin {tmin,tmax} use uniformly spaced times tmin to tmax {tmin,tmax,dt} use times tmin to tmax in steps of dt {{t1,t2,…}} use explicit times {t1,t2,…} {tspec1,tspec2,…} use different times for each path in the collection
• The tij can be numbers or any valid input to AbsoluteTime.
• The values tmin, tmax, and dt can be given as numbers, dates, or Automatic.
• TemporalData objects of equal dimensionality {td1,td2,} can be combined into a single object using TemporalData[{td1,td2,}].
• Normal[td] returns a list containing time-value pairs {tij,vij} for each path.
• Specifying td[t] gives the empirical slice distribution at time t.
• A joint empirical slice distribution for times {t1,t2,} can be obtained by specifying td[{t1,t2,}].
• 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 {tij,vij} for each path "DatePaths" a list containing date-value pairs for each path "TimeList" a list containing times tij for each path "DateList" a list containing tij for each path as dates "ValueDimensions" the dimensionality of the values "ValueList" a list containing values vij for each path "FirstTimes" a list of first times for each path "FirstDates" a list of first times for each path as dates "LastTimes" a list of last times for each path "LastDates" a list of last times for each path as dates "FirstValues" a list of values at the first time for each path "LastValues" a list of values at the last time 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 {tij,vij} for a given path "DatePath" date-value pairs {dateij,vij} for a given path "PathFunction" an interpolated path function "Values" values vi for a given path "Times" times ti for a given path "Dates" times ti for a given path as dates "SliceData" a slice through all paths at a given time "SliceDistribution" empirical distribution of slice data at a given time "FirstTime" the first time t1 for a given path "FirstDate" the first time t1 for a given path as date "LastTime" the last time for a given path "LastDate" the last time for a given path as date "FirstValue" the value v1 at the first time for a given path "LastValue" the value at the last time for a given path
• Specifying td["Path",p] gives the time-value pairs for the paths specified by p, where p can be any valid Part specification.
• The property td["PathFunction",p] returns interpolated paths specified by p.
• Specifying td["Part",p,tspec] gives TemporalData for paths specified by p and times specified by tspec. If necessary, the paths are resampled according to "PathFunction".
• Giving td["SliceData",t] returns a slice through all paths at time t, where t can be a number or valid input to AbsoluteTime.
• The specification td["SliceData",{t1,t2,}] gives a multivariate slice at times {t1,t2,}.
• TemporalData takes the following options:
•  CalendarType "Gregorian" the calendar type to use HolidayCalendar {"UnitedStates","Default"} the holiday calendar to use MetaInformation None include additional meta-information MissingDataMethod None method to use for missing values ResamplingMethod "Interpolation" the method to use for resampling paths ValueDimensions Automatic the dimensions of the values TemporalRegularity Automatic whether to assume the data is regular DateFunction Automatic how to convert dates to standard form
• 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 vij are of dimension dim. Setting attempts to automatically determine the dimension of the values from the data.
• Setting the will automatically interpolate values with head Missing, according to the ResamplingMethod setting. By default, values with head Missing are treated as missing.

# Examples

open allclose all

## Basic Examples(3)

Attach temporal information to some values:

 In[1]:=
 In[3]:=
 Out[3]=

Visualize the path:

 In[4]:=
 Out[4]=

Create a collection of paths with equivalent times:

 In[1]:=
 In[2]:=
 Out[2]=

Visualize the collection:

 In[3]:=
 Out[3]=

Compute the Mean and StandardDeviation at time :

 In[4]:=
 Out[4]=
 In[5]:=
 Out[5]=

Use dates as time stamps:

 In[1]:=
 In[2]:=

Plot the financial time series with DateListPlot:

 In[3]:=
 Out[3]=

The value of both stocks on May 24, 2009:

 In[4]:=
 Out[4]=

The average value of each stock over the date range:

 In[5]:=
 Out[5]=