makeLeadMatrix
makeLeadMatrix
makeLeadMatrix
Create lead matrix from input data.
leadMatrix = makeLeadMatrix(Y, p)
returns a matrix where columns contain 1 to p
leads of Y
.
Arguments
Y
(matrix): Input data matrix (T x k).p
(integer): Number of leads.
Returns
leadMatrix
(matrix): Matrix of lead values. Firstk
columns are lead 1, nextk
are lead 2, and so on.
Notes
- Missing values due to leading are filled with NaN.