TimeSeriesAggregate
TimeSeriesAggregate[tseries,dt]
computes the mean value of tseries over non-overlapping windows of width dt.
TimeSeriesAggregate[tseries,dt,f]
applies the function f to the values of tseries in non-overlapping windows of width dt.
Details
- TimeSeriesAggregate is often used in time series analysis to compute aggregated statistics like yearly averages or monthly totals.
- TimeSeriesAggregate breaks the time series tseries into disjoint left-closed and right-open windows of equal width dt and applies a function f to the values in each segment.
- If there are no values in a segment, the segment is ignored.
- The time series tseries can be a list of values {x1,x2,…}, a list of time-value pairs {{t1,x1},{t2,x2},…}, a TimeSeries, EventSeries, or TemporalData.
- The window width dt can be given as a positive number, a Quantity, or as a date increment.
- The window specification {dt,align} can be used to determine the alignment of new times within each window.
- Settings for window alignment align include Left, Center (default), and Right.
- TimeSeriesAggregate threads pathwise for multipath TemporalData.
Examples
open allclose allBasic Examples (3)
Scope (20)
Basic Uses (3)
Data Types (8)
Aggregate a vector in blocks of 4 using a function f:
Find the two-year average for a list of time-value pairs:
Compute the maximum for width-10 segments of a TimeSeries:
Compute a width-10 median for TemporalData:
Compute a width-5 total for an EventSeries:
Compute a six-month variance for multiple paths simultaneously:
Window Widths (5)
Specify the window width in calendar time:
Average over windows spanning five days:
Specify a window width using Quantity:
Average over windows spanning two quarters:
Applications (2)
Text
Wolfram Research (2014), TimeSeriesAggregate, Wolfram Language function, https://reference.wolfram.com/language/ref/TimeSeriesAggregate.html (updated 2017).
CMS
Wolfram Language. 2014. "TimeSeriesAggregate." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/TimeSeriesAggregate.html.
APA
Wolfram Language. (2014). TimeSeriesAggregate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TimeSeriesAggregate.html