Learn R Programming

eDMA (version 1.5-3)

Lag: Lag a vector or a matrix of observations

Description

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

Usage

Lag(mY, iK)

Arguments

mY

a vector or a matrix of observations.

iK

An integer indicating the number of lag.

Value

An object of the class numeric or matrix.

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.

Examples

Run this code
# 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)

# }

Run the code above in your browser using DataLab