Lag: Lag a vector or a matrix of observations

Description Usage Arguments Details Value Author(s) Examples

Description

Lag a vector or a matrix of observations by iK periods.

Usage

1
    Lag(mY, iK)

Arguments

mY

a vector or a matrix of observations.

iK

An integer indicating the number of lag.

Details

The function returns a numeric vector or a matrix depending on the class of mY. The dimension of the object is preserved and NA's are introduced for the missing values.

Value

An object of the class numeric or matrix.

Author(s)

Leopoldo Catania & Nima Nonejad

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
#  Code chunk of Catania and Nonejad (2016) Dynamic Model Averaging
#  for Practitioners in Economics and Finance: The eDMA Package
library(eDMA)

## load data
data("USData")

UDData_lagged <- Lag(USData, 1)


## End(Not run)


Search within the eDMA package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.