TimeSeriesShift

TimeSeriesShift[tseries,shift]

shifts the time series tseries to the left or right according to shift.

Details and Options

  • TimeSeriesShift is used to align the start of a time series with a particular time.
  • The input tseries can be a list of values {x1,x2,}, a list of time-value pairs {{t1,x1},{t2,x2},}, a TimeSeries, an EventSeries, or TemporalData.
  • Settings for shift include:
  • τshift by τ
    {k,step}shift k steps
    {{tmin}}set t1=tmin
  • The shift τ can be any real number or a time Quantity.
  • For integer k, {k} is equivalent to giving {k,MinimumTimeIncrement[tseries]}.
  • The step can be a number or date step such as "Year", "Month", "Day", etc.
  • TimeSeriesShift threads over paths for multipath TemporalData.
  • TimeSeriesShift takes the following options:
  • CalendarType"Gregorian"the calendar system to interpret the dates
    HolidayCalendar{"UnitedStates","Default"}the holiday calendar schedule for business days
    TimeZoneAutomaticthe time zone specification for dates

Examples

open allclose all

Basic Examples  (3)

Shift a time series ahead 2.5:

Shift backward 2.5:

Shift a time series ahead 30 days:

Set the starting time for a time series to 100:

Scope  (13)

Basic Uses  (7)

Shift a time series forward by 3.5:

Shift a time series backward by 3.5:

Shift by two days:

Use business days as an increment:

Compare time stamps:

Shift ahead one week and three days:

Shift the start time to 5:

Shift the dates in a time series to begin on today's date:

Data Types  (6)

Shift the times for a vector forward 2:

Shift the times for a series of time-value pairs backward by 2:

Shift the values from a TimeSeries forward by 10:

Shift the values of an EventSeries forward by 5:

Shift the paths of TemporalData ahead 10:

Shift a time series involving quantities:

Options  (3)

CalendarType  (1)

Define a time series:

Shift the data by one day and express the result using the Jewish calendar:

HolidayCalendar  (2)

Shift a time series by a business day using the default HolidayCalendar:

Use the NYSE holiday calendar:

Use a holiday calendar of a given country:

Applications  (1)

Specify rates for TimeValue:

Note that the first time step must be 0 to define the initial rate. Shift the time series:

Calculate the time value:

Possible Issues  (2)

TimeSeriesShift may break temporal regularity:

Shift by a day:

The next day in Germany is not a business day:

Preserve temporal regularity by shifting by a business day:

Compare the time series:

Specifying a new HolidayCalendar overrides that option in the input:

Shift by one business day with the same HolidayCalendar:

Specify a new HolidayCalendar:

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

Text

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

BibTeX

@misc{reference.wolfram_2021_timeseriesshift, author="Wolfram Research", title="{TimeSeriesShift}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/TimeSeriesShift.html}", note=[Accessed: 20-October-2021 ]}

BibLaTeX

@online{reference.wolfram_2021_timeseriesshift, organization={Wolfram Research}, title={TimeSeriesShift}, year={2017}, url={https://reference.wolfram.com/language/ref/TimeSeriesShift.html}, note=[Accessed: 20-October-2021 ]}

CMS

Wolfram Language. 2014. "TimeSeriesShift." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/TimeSeriesShift.html.

APA

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