vmdiffmt

Purpose

Differences matrices.

Format

y = vmdiffmt(x, d)
Parameters
  • x (TxK matrix) – data.

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

Returns

y ((T-d)xK matrix) – the differenced data.

Example

new;
cls;
library tsmt;

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

//U.K.
y_uk = yt[., 7];

//Demean data - use p=0
y_uk_diff = vmdiffdmt( y_uk, 1 );

//Plots
struct plotControl myPlot;
myPlot = plotGetDefaults( "xy" );

//Title of first graph
 plotSetTitle( &myPlot, "Original", "Arial", 16 );

//Set layout
 plotLayout( 2, 1, 1 );
 plotTS( myPlot, 19800101, 4, y_uk );

//Title of first graph
 plotSetTitle( &myPlot, "First Difference", "Arial", 16 );

//Set layout
 plotLayout( 2, 1, 2 );
 plotTS( myPlot, 19800101, 4, y_uk_diff );

Library

tsmt

Source

vmutilsmt.src