produce matrix differences
[dmat]=tdiff(x,k)
* x = input matrix (or vector) of length nobs
* k = lagged difference order
* dmat = matrix or vector, differenciated by k-periods, e.g. x(t) - x(t-k), of length nobs, (first k observations are zero)
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. | ![]() | ![]() |