aggData

Purpose

Aggregates time series data from higher to lower frequency.

Format

x_new = aggData(xt, st_freq, end_freq, method)
Parameters
  • xt (NxK matrix) – data.

  • st_freq (string) – starting frequency of data: “M” for monthly or “Q” for quarterly.

  • end_freq (string) – ending frequency of data: “M” for monthly or “Q” for quarterly.

  • method (string) – method of aggregation, “B” for beginning of period, “E” for end of period, “AVE” for moving average.

Returns

x_new (matrix) – aggregated data.

Example

new;
cls;
library tsmt;

//Real GNP data
//Seasonally adjusted
fname = getGAUSSHome() $+ "pkgs/tsmt/examples/gnp_4790.fmt";
gnp = loadd(fname);

//Aggregate the gnp data from Q to A using end-of-quarter
gnp_A_end = AggData(gnp[., 1], "Q", "Y", "E");

Library

tsmt

Source

aggregatedata.src