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, ...)
numeric
| matrix
| data.frame
]
RHS variables on which to apply the D-OLS estimation (see Details).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.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.character(1)
]
The kernel function to use for calculating the long-run variance.
Default is Bartlett kernel ("ba"
), see Details for alternatives.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"
).numeric(1)
| NULL
]
Numbers of Leads and Lags (see Details). Default is NULL
.character(1)
]
Maximal value for lags and leads if generated automatically (see Details).
Default is "k4"
.character(1)
]
Information criterion to use for the automatical calculation of lags and
leads. Default is "AIC"
.logical
]
Demeaning of residuals in getLongRunVar
.
Default is FALSE
.logical
]
Wheather to check (and if necessary convert) the arguments.
See checkVars
for further information.getBandwidthNW
.cointReg
]. List with components:
beta
[numeric
]delta
[numeric
]theta
[numeric
]beta
and delta
sd.theta
[numeric
]theta
t.theta
[numeric
]theta
p.theta
[numeric
]theta
theta.all
[numeric
]beta
, delta
and the auxiliary
leads-and-lags regressorsresiduals
[numeric
]omega.u.v
[numeric
]varmat
[matrix
]Omega
[list
]bandwidth
[list
]kernel
[character
]lead.lag
[list
]Information about the D-OLS specific arguments:
n.lag
, n.lead
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
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
"AIC"
or "BIC"
.
Default is "AIC"
.cointRegFM
,
cointRegIM
, cointReg
,
plot.cointReg
, print.cointReg
Other D-OLS: getLeadLag
,
getModD
, makeLeadLagMatrix
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)
Run the code above in your browser using DataLab