# stationarity of vector autoregression and Gibbs sampling

I'm estimating a vector autoregression (VAR) using Gibbs sampling. At each iteration, I'd like to check the coefficients to ensure the VAR is stationary. An older, related question has been posted here, but no solutions have been suggested.

Is a Gibbs sample from a posterior biased if a draw is redrawn and it doesn't yield a stationary VAR? Is there another method to overcoming draws that lead to nonstationary VARs?

You have to impose the constraints inside the prior. This means proposals that do not meet the constraints are rejected but it does not produce a biased output. And it leaves you free to pick whatever proposal distribution you wish without imposing the stationarity constraint on the proposal. This means in practice

1. start with a value of the parameters within the constrained zone
2. at each Gibbs move, check whether or not the constraints hold:
3. if not, keep the current value of the parameter and move to another component Gibbs move;
4. if so, accept the new Gibbs value and move to another component Gibbs move

This remains valid when you replace Gibbs with a Metropolis-within-Gibbs proposal/move. On the other hand, if you use Gibbs and only Gibbs for every component of the parameter vector, then simulating one given Gibbs proposal until the constraints hold is also valid. It may just be fairly time-consuming if those constraints are unlikely at this conditional stage.

• Thank you for your response. Could you please elaborate a little more? I think I understand what you mean. – Alex Dec 14 '16 at 14:29
• Regarding "On the other hand, if you use Gibbs and only Gibbs for every component of the parameter vector, then simulating one give Gibbs proposal until the constraints hold is also valid." Why only in this case? Does this mean that if the algorithm is not purely a set of Gibbs blocks, you'd have to keep the previous set of parameters rather than trying until successful? – hejseb Mar 15 '17 at 20:10

I had posted that older question. I only noticed the issue because so many papers use an analytic Bayesian approach. The analytic formula was often more likely to be stationary than the simulated set of parameters I was dealing with.

In retrospect, it's a hard problem that I shouldn't have expected an answer from on the site. Gary Koop has some papers that you might find informative and can check out the references therein.

I don't much use Gibbs sampling these days. Regardless, here are probably the things I would focus on

1. Fit the Bayesian VAR with stationary data. This means that there won't be any coefficients near one and it is a little easier to think about setting priors tightly near zero.

2. A corollary of 1 is to use a VECM structure when dealing with cointegration, rather than a regression in levels. Again, keeping the coefficients near zero is helpful for thinking about priors.

3. Reduce the dimension. I don't mean throw out some variables. But if you have a large VAR, you can instead convert it to an factor-augmented VAR with PCA and only do the VAR on the smaller subset. This will reduce the computational load.

4. Use something like a Minnesota prior on the coefficients

I'm using Stan more recently, though I haven't fit VARs in it. I would probably use some of the above tricks. Stan would probably do a good job with considering the correlation among the parameters. Really, Stan was created to deal with hierarchical parameters, where the problem is correlations between them. For a given parameter, I would expect the coefficients on its own lags to have stronger correlation than the coefficient of the other variables. Nevertheless, anytime I think of something like rejecting non-stationary sets of parameters I just imagine that it would be incredibly slow.