{bvarsv}R Documentation

Simulate from a VAR(1) with Stochastic Volatility and Time-Varying Parameters


Simulate from a VAR(1) with Stochastic Volatility and Time-Varying Parameters

Usage = NULL, A0 = NULL, Sig0 = NULL, Q = NULL, 
S = NULL, W = NULL, t = 500, init = 1000)



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), B0 corresponds to M = 2 uncorrelated zero-mean processes with moderate persistence (first-order autocorrelation of 0.6).


Initial values for (transformed) error correlation parameters: Vector of length 0.5*M*(M-1). Defaults to a vector of zeros.


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 (1e-10) on the main diagonal. This corresponds to essentially no time variation in the parameters and error term matrix elements.


Number of time periods to simulate.


Number of draws to initialize simulation (to decrease the impact of starting values).



Simulated data, with rows corresponding to time and columns corresponding to the M system variables.


Array of dimension [M, M+1, t]. Submatrix [,,l] holds the parameter matrix for time period l.


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.

See Also can be used to fit a model on data generated by 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
sim <- = 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)

[Package bvarsv version 1.1 Index]