tvVAR {tvReg} | R Documentation |
Time-varying Vector Autoregressive Models
Description
Fits a time-varying coefficients vector autorregressive model with p lags.
Usage
tvVAR(
y,
p = 1,
z = NULL,
ez = NULL,
bw = NULL,
cv.block = 0,
type = c("const", "none"),
exogen = NULL,
est = c("lc", "ll"),
tkernel = c("Triweight", "Epa", "Gaussian"),
singular.ok = TRUE
)
Arguments
y |
A matrix with dimention obs x neq (obs = number of observations and neq = number of equations) |
p |
A scalar indicating the number of lags in the model |
z |
A vector containing the smoothing variable. |
ez |
(optional) A scalar or vector with the smoothing values. If
values are not included then the vector |
bw |
An optional scalar or vector of length the number of equations. It represents the bandwidth in the estimation of trend coefficients. If NULL, it is selected by cross validation. |
cv.block |
A positive scalar with the size of the block in leave one block out cross-validation. By default 'cv.block = 0' meaning leave one out cross-validation. |
type |
A character 'const' if the model contains an intercept and 'none' otherwise. |
exogen |
A matrix or data.frame with the exogenous variables (optional) |
est |
The nonparametric estimation method, one of "lc" (default) for linear constant or "ll" for local linear. |
tkernel |
A character, either "Triweight" (default), "Epa" or "Gaussian" kernel function. |
singular.ok |
Logical. If FALSE, a singular model is an error. |
Value
An object of class 'tvvar'
The object of class tvvar
have the following components:
coefficients |
An array of dimension obs x neq (obs = number of observations, neq = number of equations in the system) with the time-varying coefficients estimates. |
fitted |
The fitted values. |
residuals |
Estimation residuals. |
x |
A list with the regressors data and the dependent variable. |
y |
A matrix with the dependent variable data. |
z |
A vector with the smoothing variable. |
ez |
A vector with the smoothing estimation values. |
bw |
Bandwidth of mean estimation. |
type |
Whether the model has a constant or not. |
exogen |
A matrix or data.frame with other exogenous variables. |
p |
Number of lags |
neq |
Number of equations |
obs |
Number of observations in estimation. |
totobs |
Number of observations in the original set. |
call |
Matched call. |
References
Casas, I., Ferreira, E., and Orbe, S. (2017) Time-Varying Coefficient Estimation in SURE Models: Application to Portfolio Management. Available at SSRN: https://ssrn.com/abstract=3043137
Primiceri, G.E. (2005) Time varying structural vector autoregressions and monetary policy. Review of Economic Studies, 72, 821-852.
See Also
bw
, tvIRF
, plot
,
print
and summary
Examples
##Inflation rate, unemployment rate and treasury bill interest rate for
##the US, as used in Primiceri (2005).
data(usmacro, package = "bvarsv")
VAR.fit <- vars::VAR(usmacro, p = 6, type = "const")
tvVAR.fit <- tvVAR(usmacro, p = 6, type = "const", bw = c(1.8, 20, 20))
plot(tvVAR.fit)