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.

Details

  • 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.

Examples

open allclose all

Basic Examples  (3)

Insert a value into a time series at time 2.5:

Replace the value at time 2 with a:

Concatenate with another time series:

Insert a value into a financial time series:

Insert the value 900 on January 1, 2013:

Replace a missing value in a time series:

Replace the missing value at time 5 with 27:

Scope  (10)

Basic Uses  (4)

Add a value to the start of a time series:

Insert the value 20 at time 0:

Interleave two time series:

Concatenate a time series and forecast:

Replace an erroneous value with Missing[]:

Data Types  (6)

Insert a value into a vector:

A time series given as time-value pairs:

Insert a value into a TimeSeries:

Upsample by a factor of 2:

Insert a value into an EventSeries:

Multiple paths given as TemporalData:

Upsample by a factor of 2:

Insert a Quantity:

Applications  (1)

Personal fitness step data for weekdays and weekends:

Combine the two time series to analyze the complete fitness routine:

Plot the daily step counts together with a healthy goal of 10,000 steps per day:

Analyze the frequency counts:

Wolfram Research (2014), TimeSeriesInsert, Wolfram Language function, https://reference.wolfram.com/language/ref/TimeSeriesInsert.html.

Text

Wolfram Research (2014), TimeSeriesInsert, Wolfram Language function, https://reference.wolfram.com/language/ref/TimeSeriesInsert.html.

CMS

Wolfram Language. 2014. "TimeSeriesInsert." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TimeSeriesInsert.html.

APA

Wolfram Language. (2014). TimeSeriesInsert. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TimeSeriesInsert.html

BibTeX

@misc{reference.wolfram_2024_timeseriesinsert, author="Wolfram Research", title="{TimeSeriesInsert}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/TimeSeriesInsert.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_timeseriesinsert, organization={Wolfram Research}, title={TimeSeriesInsert}, year={2014}, url={https://reference.wolfram.com/language/ref/TimeSeriesInsert.html}, note=[Accessed: 21-November-2024 ]}