Learn R Programming

cointReg (version 0.2.0)

cointRegFM: Fully Modified OLS

Description

Computes the Phillips and Hansen (1990) Fully Modified OLS estimator.

Usage

cointRegFM(x, y, deter, kernel = c("ba", "pa", "qs", "tr"), bandwidth = c("and", "nw"), demeaning = FALSE, check = TRUE, ...)

Arguments

x
[numeric | matrix | data.frame] RHS variables on which to apply the FM-OLS estimation (see Details).
y
[numeric | matrix | data.frame] LHS variable(s) on which to apply the FM-OLS estimation (see Details). Usually one-dimensional, but a matrix or data.frame with more than one column is also possible.
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").
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.

Value

[cointReg]. List with components:
delta [numeric | matrix]
coefficients as vector / matrix
beta [numeric | matrix]
coefficients as vector / matrix
theta [numeric | matrix]
combined coefficients of beta and delta as vector / matrix
sd.theta [numeric]
standard errors for theta
t.theta [numeric]
t-values for theta
p.theta [numeric]
p-values for theta
residuals [numeric]
FM-OLS residuals (first value is always missing)
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
beta.OLS [numeric | matrix]
OLS coefficients as vector / matrix
delta.OLS [numeric | matrix]
OLS coefficients as vector / matrix
u.OLS [numeric]
OLS residuals
bandwidth [list]
number and name of bandwidth
kernel [character]
abbr. name of kernel type

Details

The equation for which the FM-OLS estimator is calculated: $$y = \delta \cdot D + \beta \cdot x + u$$ with $D$ as the deterministics matrix. Then $\theta = (\delta', \beta')'$ is the full parameter vector.

The calculation of t-values and the variance-covariance matrix is only possible, if y is one-dimensional.

References

  • Phillips, P.C.B. and B. Hansen (1990): "Statistical Inference in Instrumental Variables Regression with I(1) Processes," Review of Economic Studies, 57, 99--125, DOI:10.2307/2297545.

See Also

Other cointReg: cointRegD, cointRegIM, cointReg, plot.cointReg, print.cointReg

Examples

Run this code
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 = cointRegFM(x, y, deter, kernel = "ba", bandwidth = "and")
print(test)

Run the code above in your browser using DataLab