Bayesian VAR

For questions about EViews Add-ins available from the EViews Add-ins webpage. Note each add-in available on our webpage will have its own individual thread.

Moderators: EViews Gareth, EViews Moderator, EViews Esther

EViews Esther
EViews Developer
Posts: 149
Joined: Fri Sep 03, 2010 7:57 am

Re: Bayesian VAR

Postby EViews Esther » Thu May 24, 2012 11:57 am

The Ko-Ko prior requires the OLS estimates in its calculation, however, this calculation could not be done due to the singularity problem.

One possible solution for your project is to obtain a longer period of sample (Currently, the given sample size is 21).

vanessa14
Posts: 7
Joined: Sun Aug 05, 2012 8:40 pm

Re: Bayesian VAR

Postby vanessa14 » Mon Aug 06, 2012 6:52 am

I have the same problem of near singularity (_sh01 not defined), but I can't expand the sample.. Do you suggest any other way to fix this? Thank you.

Vanessa

EViews Esther
EViews Developer
Posts: 149
Joined: Fri Sep 03, 2010 7:57 am

Re: Bayesian VAR

Postby EViews Esther » Mon Aug 06, 2012 11:33 am

Unfortunately, the current BVAR algorithm cannot solve the singularity problem. However, I will put it on my list.

vanessa14
Posts: 7
Joined: Sun Aug 05, 2012 8:40 pm

Re: Bayesian VAR

Postby vanessa14 » Tue Aug 14, 2012 4:32 pm

Hi, just to give a feed-back to you guys, I kind of solved my problem. Turns out the message "_sh1 is not defined" wasn't because of singularity, but because of bad conditioning of the matrix, and I fixed it by changing the scale of the dependent variable, from millions to billions. It worked for me! it's worth to try.

Vanessa

sfrable
Posts: 1
Joined: Tue Jul 20, 2010 8:26 am

Re: Bayesian VAR

Postby sfrable » Wed Oct 03, 2012 11:58 am

I am receiving the same problem with "_sh1 is not defined."

How big does the sample size have to be in order to not have near singularity?

yoz2k3
Posts: 2
Joined: Sun Oct 24, 2010 7:15 am

Re: Bayesian VAR

Postby yoz2k3 » Fri May 10, 2013 5:50 am

Hi Gareth, Esther,

Thanks for this add-in, it is really useful and the interface is friendly and does pretty much all the work. I have some questions though:
1) is there any chance to get into this add-in the possibility to create the std error bands for the IRFs graph?
2) is there any chance to get variance decomposition graphs as well?
3) regarding the IRFs, can you help me understand what is the impulse size, sign and if we would be able to change it? (I assume, by altering the "impulse.prg" file. In the add-in documentation there was nothing referring to the IRFs)

Thanks a lot.

sean123
Posts: 34
Joined: Wed Apr 25, 2012 11:53 am

Re: Bayesian VAR

Postby sean123 » Thu Jul 25, 2013 12:36 am

Hi,

If I'd like to use the Sims-Zha Normal-Wishart prior, but change the prior expectation of the AR(1) coefficients to 0 instead of 1, where would I make this change? I can't really seem to figure out where it is exactly... Thanks in advance!

sean123
Posts: 34
Joined: Wed Apr 25, 2012 11:53 am

Re: Bayesian VAR

Postby sean123 » Mon Jul 29, 2013 4:59 am

I found it! In the szmodel.prg file,

Code: Select all

{%temp1} = @transpose({%X})*{%Y}+{%temp1}


should simply be changed to

Code: Select all

{%temp1} = @transpose({%X})*{%Y}


and, correspondingly, for the covariance matrix

Code: Select all

matrix {%St} = ({%S0} + @inner({%Y},{%Y}) + {%temp} - @transpose({%Bh})*{%hstar1}*{%Bh} )


should be changed to

Code: Select all

matrix {%St} = ({%S0} + @inner({%Y},{%Y}) - @transpose({%Bh})*{%hstar1}*{%Bh} )

sean123
Posts: 34
Joined: Wed Apr 25, 2012 11:53 am

Re: Bayesian VAR

Postby sean123 » Fri Aug 02, 2013 7:37 am

Another question: Why is the prior degrees of freedom (v) equal to the number of endogenous variables (m) plus 1? In "Numerical Methods for Estimation and Inference in Bayesian VAR-models" (1997) by Kadiyala & Karlsson the number of df is defined to be v>m+1, not v>=m+1. I know your reference is Brandt & Freeman (2006), but I can't find it in there. They say that "v>0" which doesn't make much sense either...

EViews Esther
EViews Developer
Posts: 149
Joined: Fri Sep 03, 2010 7:57 am

Re: Bayesian VAR

Postby EViews Esther » Fri Aug 02, 2013 10:07 am

sean123 wrote: the number of df is defined to be v>m+1, not v>=m+1. I know your reference is Brandt & Freeman (2006), but I can't find it in there. They say that "v>0" which doesn't make much sense either...

The Inverse-Wishart (or Wishart) distribution has finite expectations and can be invertible only when v > m-1. Therefore, many Bayesian economists set the degree of freedom as m+1.

Please note that while Kadyiala and Karlsson (1997) provided the genaralizations of the natural conjugate Normal-Wishart prior (required E(beta) = beta_hat and V(beta) = (v-m-1)^(-1)(Sigma_hat kron Omega_hat) where v > m +1), Sims-Zha (1998) showed how the dummy observations can be helpful to choose the priors.

sean123
Posts: 34
Joined: Wed Apr 25, 2012 11:53 am

Re: Bayesian VAR

Postby sean123 » Mon Aug 05, 2013 3:48 am

EViews Esther wrote:
sean123 wrote: the number of df is defined to be v>m+1, not v>=m+1. I know your reference is Brandt & Freeman (2006), but I can't find it in there. They say that "v>0" which doesn't make much sense either...

The Inverse-Wishart (or Wishart) distribution has finite expectations and can be invertible only when v > m-1. Therefore, many Bayesian economists set the degree of freedom as m+1.

Please note that while Kadyiala and Karlsson (1997) provided the genaralizations of the natural conjugate Normal-Wishart prior (required E(beta) = beta_hat and V(beta) = (v-m-1)^(-1)(Sigma_hat kron Omega_hat) where v > m +1), Sims-Zha (1998) showed how the dummy observations can be helpful to choose the priors.


I see. Thanks for your reply, I think I get it now! (Also, I don't currently make use of the dummy observations, so as far as I can tell the prior I'm working with is essentially the 'standard' Normal-Wishart prior, only with the construction of the prior covariance matrices as laid out in Sims & Zha (1998)).

sean123
Posts: 34
Joined: Wed Apr 25, 2012 11:53 am

Re: Bayesian VAR

Postby sean123 » Wed Aug 07, 2013 3:02 am

Just to have this confirmed: the impulse responses are not accumulated, correct?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 12291
Joined: Tue Sep 16, 2008 5:38 pm

Re: Bayesian VAR

Postby EViews Gareth » Wed Aug 07, 2013 6:44 am

Correct.
Follow us on Twitter @IHSEViews

noxifero
Posts: 1
Joined: Tue Sep 03, 2013 5:53 am

Re: Bayesian VAR

Postby noxifero » Tue Sep 03, 2013 5:58 am

Hello everybody,

I was wondering whether there is a way to select the method by which the initial residual covariance is estimated (e.g. on the full VAR or equation by equation, i.e. univariate) or at least whether there's a way to know which is the default methodology, in case it could not be changed.

Thanks very much in advance.

Andrea

rsabbadini
Posts: 1
Joined: Fri Nov 29, 2013 11:44 am

Forecasting with Models created by B-VAR

Postby rsabbadini » Fri Nov 29, 2013 12:42 pm

First of all, thank you for this Add-In.

I am using it to estimate and forecast B-VAR with EXOGENOUS variables under the SZ prior. The B-VAR is estimated correctly and I request a model to be created. I was obtaining really weird forecast. Then I saw the problem. Even if I estimate a B-VAR without exogenous variables it includes a constant term. That is fine. But when I include one exogenous variable, for example @trend(), in the model created (look at the Source Text) the coefficient associated with the constant in fact multiplies the exogenous variable.
In any equation of the B-VAR, in the Spool, the constant appears as the last variable, after both endogenous and exogenous variable. But in the model it appears after the endogenous variable and before the exogenous ones. So exogenous variable multiply the wrong coefficients, they are in an incorrect order.
That is the reason I need your help.

Beyond that I would like to know if in the B-VAR Add-In it is possible to use the logarithmic transformation of the variables, log(x) for example, as it is in the regular VAR command. Since I am estimating the model in logarithmic but I want to forecast the untransformed variable, this would be helpful.

Thank you!


Return to “Add-in Support”

Who is online

Users browsing this forum: No registered users and 2 guests