lag_mts {bootCT}R Documentation

Create matrix of lagged variables

Description

This function lags a set of variables in a matrix, each with a separate index. It is also possible to retain only the last lag order.

Usage

lag_mts(X, k, last.only = F)

Arguments

X

numeric matrix whose columns are subject to lagging

k

vector of lag orders

last.only

If TRUE only the k-th order lag will be computed, otherwise all lags from 1 to k

Value

a matrix whose columns are the original variables and the k-th order lagged variables. Column name suffix ".lx".

Examples


data(ger_macro)

lag_mts(X = ger_macro, k = 3, last.only = FALSE)


[Package bootCT version 2.1.0 Index]