tsdiff#

Purpose#

Differences matrices with or without seasonality.

Format#

y = tsdiff(x, d[, s])#
Parameters:
  • x (TxK matrix) – Data.

  • d (scalar) – Order of differencing, the number of periods over which differencing occurs.

  • s (scalar) – Optional argument, seasonal parameter.

Returns:

y (Matrix) – Differenced data.

Example#

new;
cls;
library tsmt;

// Step One: data
yt = loadd( getGAUSSHome() $+ "pkgs/tsmt/examples/panel_g.csv", "date($Date) + ." );

// U.K.
y_uk = yt[., "UK"];

/*
** Set up parameters
*/
// Order of differencing
d = 1;

// Seasonal adjustment
s = 4;

// First difference of data
y_uk_diff = tsdiff(y_uk, d);

// First difference of data
// adjusted for seasonality
y_uk_sdiff = tsdiff(y_uk, d, s);

Library#

tsmt

Source#

vmutilsmt.src