sim.var1.sv.tvp {bvarsv} | R Documentation |
Simulate from a VAR(1) with Stochastic Volatility and Time-Varying Parameters
Description
Simulate from a VAR(1) with Stochastic Volatility and Time-Varying Parameters
Usage
sim.var1.sv.tvp(B0 = NULL, A0 = NULL, Sig0 = NULL, Q = NULL,
S = NULL, W = NULL, t = 500, init = 1000)
Arguments
B0 |
Initial values of mean parameters: Matrix of dimension |
A0 |
Initial values for (transformed) error correlation parameters: Vector of length |
Sig0 |
Initial values for log error term volatility parameters: Vector of length |
Q , S , W |
Covariance matrices for the innovation terms in the time-varying parameters ( |
t |
Number of time periods to simulate. |
init |
Number of draws to initialize simulation (to decrease the impact of starting values). |
Value
data |
Simulated data, with rows corresponding to time and columns corresponding to the |
Beta |
Array of dimension |
H |
Array of dimension |
Note
The choice of ‘reasonable’ values for the elements of Q
, S
and W
requires some care. If the elements of these matrices are too large, parameter variation can easily become excessive. Too large elements of Q
can lead the parameter matrix into regions which correspond to explosive processes. Too large elements in
S
and (especially) W
may lead to excessive error term variances.
Author(s)
Fabian Krueger
References
Primiceri, G.E. (2005): ‘Time Varying Structural Vector Autoregressions and Monetary Policy’, Review of Economic Studies 72, 821-852.
See Also
bvar.sv.tvp
can be used to fit a model on data generated by sim.var1.sv.tvp
. This can be a useful way to analyze the performance of the estimation methods.
Examples
## Not run:
# Generate data from a model with moderate time variation in the parameters
# and error term variances
set.seed(5813)
sim <- sim.var1.sv.tvp(Q = 1e-5*diag(6), S = 1e-5*diag(1), W = 1e-5*diag(2))
# Plot both series
matplot(sim$data, type = "l")
# Plot AR(1) parameters of both equations
matplot(cbind(sim$Beta[1,2,], sim$Beta[2,3,]), type = "l")
## End(Not run)