Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

getLeadLag

Leads and Lags


Description

Generates "optimal" numbers of leads and lags for the Dynamic OLS estimator.

Usage

getLeadLag(x, y, deter, max.lag, max.lead, ic = c("AIC", "BIC"),
  symmet = FALSE, check = FALSE)

Arguments

x

[numeric | matrix | data.frame]
RHS variables on which to apply the D-OLS estimation (see Details).

y

[numeric | matrix | data.frame]
LHS variable(s) on which to apply the D-OLS estimation (see Details). Has to be one-dimensional. If matrix, it may have only one row or column, if data.frame just one column.

deter

[numeric | matrix | data.frame | NULL]
Deterministic variable to include in the equation (see Details). If it's NULL or missing, no deterministic variable is included in the model.

max.lead, max.lag

[numeric(1)]
Maximal numbers of leads and lags, have to be non-negative integer values.

ic

[character(1)]
Information criterion (one of "AIC" or "BIC").

symmet

[logical(1)]
If TRUE, only looks for equal leads and lags.

check

[logical]
Wheather to check (and if necessary convert) the arguments. See checkVars for further information.

Value

[numeric(2)]. "Optimal" numbers of leads and lags.

See Also

Examples

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:::getLeadLag(x = x, y = y, deter = deter, max.lag = 5,
                      max.lead = 5, ic = "AIC", symmet = FALSE)

cointReg

Parameter Estimation and Inference in a Cointegrating Regression

v0.2.0
GPL-3
Authors
Philipp Aschersleben [aut, cre], Martin Wagner [aut] (Author of underlying MATLAB code.)
Initial release
2016-06-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.