The purpose of this vignette is to show how to estimate Bayesian Vector Autoregressive Models using the package bvar2.
We do this by using a
The model is estimated in 2 steps:
We can use an estimated model to compute impulse-response functions or make forecasts. Here, we will compute impulse-response functions from an estimated model.
In the first step, we set up the prior. For the simplest case we use an uninformative prior.
While the uninformative prior itself has (as the name says) no prior information about the parameters we aim to estimate. We still have to provide the creator function with some information about the model. These information are
In addition, we have to provide the data to estimate the parameters. The function uses the data to extract some basic information, such as the number of variables, of it.
Having created the prior we now estimate a bvar model.
bvestimate <- bvars::bvar(mydata=USMonPol,priorObj = prior,
stabletest = T,nthin = 2,
nreps = 1100, burnin = 100)
## Initialize MCMC sampler for uninformative prior
## draw no. 1000