Wolfram Research

Function Repository Resource:

TimeSeriesZero

Source Notebook

Shift a time series to start at 0 seconds

Contributed by: Flip Phillips

ResourceFunction["TimeSeriesZero"][ts]

shifts time series ts so as to have ts["FirstTime"] equal to 0.

Details and Options

Input should be a TimeSeries.

Examples

Basic Examples

Shift a time series to start at 0 seconds:

In[1]:=
ts = DeviceReadTimeSeries["RandomSignalDemo", {2, .1}];
In[2]:=
ts["FirstTime"]
Out[2]=
In[3]:=
ResourceFunction["TimeSeriesZero"][ts]
Out[3]=

Scope

Resetting a calendar time series sets the origin at 01 January 1900:

In[4]:=
ts = FinancialData["GOOGL", {"January 2012", "January 2013"}];
In[5]:=
ResourceFunction["TimeSeriesZero"][ts]
Out[5]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Resource History

License Information