TimeSeriesInsert

TimeSeriesInsert[tseries,{t,v}]
inserts a value v at time t in the time series tseries.

TimeSeriesInsert[tseries1,tseries2]
inserts the time-value pairs from tseries2 into tseries1.

DetailsDetails

  • TimeSeriesInsert is often used to add a value to a time series, to concatenate two time series, or to replace erroneous or missing values.
  • The time series tseries can be a list of numeric values {x1,x2,}, a list of time-value pairs {{t1,x1},{t2,x2},}, a TimeSeries, an EventSeries, or TemporalData.
  • The time t can be given as numbers or dates.
  • If a value is already present at time t it will be replaced by v.

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Insert a value into a time series at time 2.5:

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

Replace the value at time 2 with a:

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

Concatenate with another time series:

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

Insert a value into a financial time series:

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

Insert the value 900 on January 1, 2013:

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

Replace a missing value in a time series:

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

Replace the missing value at time 5 with 27:

In[4]:=
Click for copyable input
In[5]:=
Click for copyable input
Out[5]=
Introduced in 2014
(10.0)
Translate this page: