cointRegIM(x, y, deter, selector = 1, t.test = TRUE, kernel = c("ba", "pa", "qs", "tr"), bandwidth = c("and", "nw"), check = TRUE, ...)
numeric
| matrix
| data.frame
]
RHS variables on which to apply the IM-OLS estimation (see Details).numeric
| matrix
| data.frame
]
LHS variable(s) on which to apply the IM-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.numeric
]
Choose the regression type: 1
, 2
, or c(1, 2)
(see Details). Default is 1
.logical
]
Wheather to calculate t-values for the coefficients of the first
regression. Default is TRUE
. Attention: Needs more calculation
time, because an additional FM-OLS model has to be fitted to get the
long-run variance.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"
).logical
]
Wheather to check (and if necessary convert) the arguments.
See checkVars
for further information.getBandwidthNW
.cointReg
]. List with components:
delta
[numeric
]beta
[numeric
]gamma
[numeric
]theta
[numeric
]beta
, delta
sd.theta
[numeric
]theta
coefficientst.theta
[numeric
]theta
coefficientsp.theta
[numeric
]theta
coefficientstheta.all
[numeric
]beta
, delta
, gamma
residuals
[numeric
]u.plus
.u.plus
[numeric
]residuals
above.omega.u.v
[numeric
]cointRegFM
(in case of argument t.test
is TRUE
)
or NULL
varmat
[matrix
]Omega
[matrix
]NULL
(no long-run variance matrix for this regression type)bandwidth
[list
]number
and name
of bandwidth if t.test = TRUE
kernel
[character
]t.test = TRUE
delta2
[numeric
]beta2
[numeric
]gamma2
[numeric
]lambda2
[numeric
]theta2
[numeric
]beta2
, delta2
, gamma2
and
lambda2
for regression type 2u.plus2
[numeric
]The equation for which the IM-OLS estimator is calculated (type 2): $$S_y = \delta \cdot S_D + \beta \cdot S_x + \gamma \cdot x + \lambda \cdot Z + u$$ where $S[y]$, $S[x]$ and $S[D]$ are the cumulated sums of $y$, $x$ and $D$ (with $D$ as the deterministics matrix) and $Z$ as defined in equation (19) in Vogelsang and Wagner (2015). Then $\theta = (\delta', \beta', \gamma', \lambda')'$ is the full parameter vector.
cointRegD
,
cointRegFM
, cointReg
,
plot.cointReg
, print.cointReg
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 = cointRegIM(x, y, deter, selector = c(1, 2), t.test = TRUE,
kernel = "ba", bandwidth = "and")
print(test)
Run the code above in your browser using DataLab