vmsdetrend#

Purpose#

Seasonally detrends data.

Format#

y_detrended = vmsdetrend(y, freq, seas)#
Parameters:
  • y (matrix) – Tx1, data to be detrended.

  • freq (Scalar) – frequency of the data per year. Valid options include: [1] Yearly [4] Quarterly [12] Monthly.

  • seas (Scalar) – number of observations per season.

Returns:

y_detrended (matrix) – detrended data.

Example#

new;
cls;
library tsmt;

// Generate random data
y = rndn((25*12),1);

// Monthly frequency
freq = 12;

// Seasonal dummy component every three months
seas = 3;

// Detrend data
{ y_d, beta } = vmsdetrend(y, freq, seas);

Library#

tsmt

Source#

vmsdetrend.src