TimeSeriesWindow

TimeSeriesWindow[tseries,{tmin,tmax}]

gives the elements of the time series tseries that fall between tmin and tmax.

TimeSeriesWindow[tseries,windowspec]

gives the elements of the time series tseries that satisfy the window specification windowspec.

Details and Options

  • TimeSeriesWindow is used to select a subset of a time series that falls in a given window.
  • 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, EventSeries, or TemporalData.
  • The window times tmin and tmax can be given as Automatic, numbers, or dates. When tmin or tmax are given as Automatic, the first and last times in tseries are used, respectively.
  • The window specification windowspec can be given as:
  • {tmin,tmax}time or date limits
    DateObject[_, gran]a single granular DateObject
    dayspecuse day specification
  • Possible dayspec types are: "Weekday", "Weekend", Monday through Sunday, "BeginningOfMonth", "EndOfMonth", "BusinessDay" and "Holiday".
  • TimeSeriesWindow takes the following options:
  • ResamplingMethodAutomaticthe method to use for resampling paths
    IncludeWindowTimesFalsewhether to create values at tmin and tmax if not members of the time stamps
    CalendarType"Gregorian"the calendar system to interpret the dates
    HolidayCalendar{"UnitedStates","Default"}the holiday calendar schedule for business days
  • By default, the window times tmin and tmax are included only if they are also members of the times {t1,t2,} in tseries.
  • If tmin and tmax are outside the range of the {t1,t2,}, then the t1 and tn are used, respectively.

Examples

open allclose all

Basic Examples  (1)

Extract a portion of a time series:

Take the elements between May 4 and August 4 of 2012:

Extract elements from June 2012:

Extract elements that fall at the end of each month:

Scope  (8)

Basic Uses  (3)

Select a subset of a time series:

Select Fridays from a time series with dates:

Visualize different subsets of a time series:

Split the data into three parts:

Data Types  (5)

Extract three elements from a vector:

Select the values for a specific interval of times in a list of time-value pairs:

Extract 50 values from a TimeSeries:

Overlay the window over the original data:

Extract 30 values from an EventSeries:

Overlay the window over the original data:

Restrict the paths of TemporalData to a smaller interval:

Options  (4)

IncludeWindowTimes  (1)

By default, the window times are included only if they are among the time stamps:

If the window times are not time stamps, they are excluded:

Specify that window times should be included:

Include only the right window time:

ResamplingMethod  (1)

Specify what values to assign to window times that are not among the time stamps:

By default, interpolation of order 0 is used:

Use interpolation of order 1:

Use a fixed constant:

CalendarType  (1)

Use the Jewish calendar:

HolidayCalendar  (1)

Extract business days:

Applications  (2)

This time series contains the number of steps taken daily by a person during a period of five months:

Display the daily step counts for each of the months:

Display the total number of steps for each month:

Visualize the temperature in Champaign during the summer of 2014:

Extract the temperatures for summer months:

Find some basic descriptive statistics:

Introduced in 2014
 (10.0)
 |
Updated in 2019
 (12.0)