Learn R Programming

cointReg (version 0.2.0)

getModD: Get D OLS model.

Description

Generates an lm model for the Dynamic OLS estimator.

Usage

getModD(x, y, deter, n.lag, n.lead, check = FALSE)

Arguments

x
[matrix] RHS variables of the D OLS estimation.
y
[matrix] LHS variable(s) of the D OLS estimation.
deter
[matrix] Matrix of deterministic variables to include in the D OLS model.
n.lag, n.lead
[numeric(1)] Number of lags and leads, have to be non-negative integer values.
check
[logical] Wheather to check (and if necessary convert) the arguments. See checkVars for further information.

Value

[lm]. An lm object, containing an additional list element (aux) with D-OLS specific objects:
Z [matrix]
jointed matrix of deterministics and x
x.delta [matrix]
differences of x
dx.all [matrix]
leads-and-lags matrix
all.trunc [matrix]
truncated version of jointed matrix of Z and dx.all
y.trunc [matrix]
truncated version of y

See Also

Other D-OLS: cointRegD, getLeadLag, makeLeadLagMatrix

Examples

Run this code
set.seed(1909)
y <- matrix(cumsum(rnorm(100)), ncol = 1)
x <- matrix(rep(y, 4) + rnorm(400, mean = 3, sd = 2), ncol = 4)
deter <- cbind(1, 1:100)
cointReg:::getModD(x = x, y = y, deter = deter, n.lag = 2, n.lead = 3)

Run the code above in your browser using DataLab