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

cointRegD

Dynamic OLS


Description

Computes the Saikkonen (1990) Dynamic OLS estimator.

Usage

cointRegD(x, y, deter, kernel = c("ba", "pa", "qs", "tr"),
  bandwidth = c("and", "nw"), n.lead = NULL, n.lag = NULL,
  kmax = c("k4", "k12"), info.crit = c("AIC", "BIC"), demeaning = FALSE,
  check = TRUE, ...)

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.

kernel

[character(1)]
The kernel function to use for calculating the long-run variance. Default is Bartlett kernel ("ba"), see Details for alternatives.

bandwidth

[character(1) | integer(1)]
The bandwidth to use for calculating the long-run variance. Default is Andrews (1991) ("and"), an alternative is Newey West (1994) ("nw").

n.lead, n.lag

[numeric(1) | NULL]
Numbers of Leads and Lags (see Details). Default is NULL.

kmax

[character(1)]
Maximal value for lags and leads if generated automatically (see Details). Default is "k4".

info.crit

[character(1)]
Information criterion to use for the automatical calculation of lags and leads. Default is "AIC".

demeaning

[logical]
Demeaning of residuals in getLongRunVar. Default is FALSE.

check

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

...

Arguments passed to getBandwidthNW.

Details

The equation for which the FM-OLS estimator is calculated:

y = δ * D + β * x + u

with D as the deterministics matrix. Then θ = (δ', β')' is the full parameter vector.

Information about the D-OLS specific arguments:

n.lag, n.lead

A positive number to set the number of lags and leads. If at least one of them is equal to NULL (default), the function getLeadLag will be used to calculate them automatically (see Choi and Kurozumi (2012) for details). In that case, the following two arguments are needed.

kmax

Maximal value for lags and leads, when they are calculated automatically. If "k4", then the maximum is equal to floor(4 * (x.T/100)^(1/4)), else it's floor(12 * (x.T/100)^(1/4)) with x.T is equal to the data's length. One of "k4" or "k12". Default is "k4".

info.crit

Information criterion to use for the automatical calculation of lags and leads. One of "AIC" or "BIC". Default is "AIC".

Value

[cointReg]. List with components:

beta [numeric]

coefficients of the regressors

delta [numeric]

coefficients of the deterministics

theta [numeric]

combined coefficients of beta and delta

sd.theta [numeric]

standard errors for theta

t.theta [numeric]

t-values for theta

p.theta [numeric]

p-values for theta

theta.all [numeric]

combined coefficients of beta, delta and the auxiliary leads-and-lags regressors

residuals [numeric]

D-OLS residuals (length depends on leads and lags)

omega.u.v [numeric]

conditional long-run variance based on OLS residuals

varmat [matrix]

variance-covariance matrix

Omega [list]

the whole long-run variance matrix and parts of it

bandwidth [list]

number and name of the calculated bandwidth

kernel [character]

abbr. name of kernel type

lead.lag [list]

leads-and-lags parameters

References

  • Phillips, P.C.B. and M. Loretan (1991): "Estimating Long Run Economic Equilibria," Review of Economic Studies, 58, 407–436, DOI:10.2307/2298004.

  • Saikkonen, P. (1991): "Asymptotically Efficient Estimation of Cointegrating Regressions," Econometric Theory, 7, 1–21, DOI:10.1017/S0266466600004217.

  • Stock, J.H. and M.W. Watson (1993): "A Simple Estimator of Cointegrating Vectors in Higher Order Integrated Systems," Econometrica, 61, 783–820, DOI:10.2307/2951763.

See Also

Examples

set.seed(1909)
x1 <- cumsum(rnorm(100, mean = 0.05, sd = 0.1))
x2 <- cumsum(rnorm(100, sd = 0.1)) + 1
x3 <- cumsum(rnorm(100, sd = 0.2)) + 2
x <- cbind(x1, x2, x3)
y <- x1 + x2 + x3 + rnorm(100, sd = 0.2) + 1
deter <- cbind(level = 1, trend = 1:100)
test <- cointRegD(x, y, deter, n.lead = 2, n.lag = 2,
                    kernel = "ba", bandwidth = "and")
print(test)
test2 <- cointRegD(x, y, deter, kmax = "k4", info.crit = "BIC",
                     kernel = "ba", bandwidth = "and")
print(test2)

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.