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 (1) 

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]=
In[4]:=
%["FirstTime"]
Out[4]=

Scope (1) 

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

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

Publisher

Flip Phillips

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 1.0.0 – 22 March 2019

License Information