sim.var1.sv.tvp {bvarsv} | R Documentation |
Simulate from a VAR(1) with Stochastic Volatility and Time-Varying Parameters
sim.var1.sv.tvp(B0 = NULL, A0 = NULL, Sig0 = NULL, Q = NULL, S = NULL, W = NULL, t = 500, init = 1000)
B0 |
Initial values of mean parameters: Matrix of dimension [M, M+1], where the first column holds the intercept vector and the other columns hold the matrix of first-order autoregressive coefficients. By default (NULL), |
A0 |
Initial values for (transformed) error correlation parameters: Vector of length 0.5*M*(M-1). Defaults to a vector of zeros. |
Sig0 |
Initial values for log error term volatility parameters: Vector of length M. Defaults to a vector of zeros. |
Q, S, W |
Covariance matrices for the innovation terms in the time-varying parameters (B, A, Sig). The matrices are symmetric, with dimensions equal to the number of elements in B, A and Sig, respectively. Default to diagonal matrices with very small terms ( |
t |
Number of time periods to simulate. |
init |
Number of draws to initialize simulation (to decrease the impact of starting values). |
data |
Simulated data, with rows corresponding to time and columns corresponding to the M system variables. |
Beta |
Array of dimension [M, M+1, t]. Submatrix [,,l] holds the parameter matrix for time period l. |
H |
Array of dimension [M, M, t]. Submatrix [,,l] holds the error term covariance matrix for period l. |
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 B into regions which correspond to explosive processes. Too large elements in S
and (especially) W
may lead to excessive error term variances.
Fabian Krueger
Primiceri, G.E. (2005): ‘Time Varying Structural Vector Autoregressions and Monetary Policy’, Review of Economic Studies 72, 821-852.
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.
## 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)