Name
tdiff — produce matrix differences
CALLING SEQUENCE
[dmat]=tdiff(x,k)
PARAMETERS
- Input
x = input matrix (or vector) of length nobs
k = lagged difference order
- Output
dmat = matrix or vector, differenciated by k-periods, e.g. x(t) - x(t-k), of length nobs, (first k observations are zero)
DESCRIPTION
Produces matrix differences.
EXAMPLE
x1=ones(7,1);x2=[1:7]';y = tdiff([x1 x2],2)
//returns
//! 0. 0. !
//! 0. 0. !
//! 0. 2. !
//! 0. 2. !
//! 0. 2. !
//! 0. 2. !
//! 0. 2. !
dep = tdiff(r,1);
// Example taken from function cadf: vector r is differenciated once.