Learn R Programming

tempdisagg (version 0.22)

ta: Temporal Aggregation of Time Series

Description

Performs temporal aggregation of high to low frequency time series. Currently, ta only works with ts or mts time series objects.

Usage

ta(x, conversion = "sum", to = "annual")

Arguments

x
a time series object of class "ts" or "mts".
conversion
type of conversion: "sum", "average", "first" or "last".
to
(low-frequency) destination frequency as a character string ("annual" or "quarterly") or as a scalar (e.g. 1, 2, 4).

Value

  • ta returns an object of class "ts" or "mts", depending on the class of the input series.

Details

ta is used to aggregate a high frequency time series into a low frequency series, while the latter is either the sum, the average, the first or the last value of the high-frequency series. ta is the inverse function of td. If applied to an output series of td, ta yields the original series.

See Also

td for the main function for temporal disaggregation.

Examples

Run this code
data(swisspharma)

sales.q.a <- ta(sales.q, conversion = "sum", to = "annual")
all.equal(sales.a, sales.q.a)

Run the code above in your browser using DataLab