Bayesian VAR
Moderators: EViews Gareth, EViews Moderator, EViews Esther

 EViews Developer
 Posts: 149
 Joined: Fri Sep 03, 2010 7:57 am
Re: Bayesian VAR
The KoKo 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).
One possible solution for your project is to obtain a longer period of sample (Currently, the given sample size is 21).
Re: Bayesian VAR
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
Vanessa

 EViews Developer
 Posts: 149
 Joined: Fri Sep 03, 2010 7:57 am
Re: Bayesian VAR
Unfortunately, the current BVAR algorithm cannot solve the singularity problem. However, I will put it on my list.
Re: Bayesian VAR
Hi, just to give a feedback 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
Vanessa
Re: Bayesian VAR
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?
How big does the sample size have to be in order to not have near singularity?
Re: Bayesian VAR
Hi Gareth, Esther,
Thanks for this addin, 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 addin 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 addin documentation there was nothing referring to the IRFs)
Thanks a lot.
Thanks for this addin, 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 addin 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 addin documentation there was nothing referring to the IRFs)
Thanks a lot.
Re: Bayesian VAR
Hi,
If I'd like to use the SimsZha NormalWishart 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!
If I'd like to use the SimsZha NormalWishart 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!
Re: Bayesian VAR
I found it! In the szmodel.prg file,
should simply be changed to
and, correspondingly, for the covariance matrix
should be changed to
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} )
Re: Bayesian VAR
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 VARmodels" (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 Developer
 Posts: 149
 Joined: Fri Sep 03, 2010 7:57 am
Re: Bayesian VAR
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 InverseWishart (or Wishart) distribution has finite expectations and can be invertible only when v > m1. 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 NormalWishart prior (required E(beta) = beta_hat and V(beta) = (vm1)^(1)(Sigma_hat kron Omega_hat) where v > m +1), SimsZha (1998) showed how the dummy observations can be helpful to choose the priors.
Re: Bayesian VAR
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 InverseWishart (or Wishart) distribution has finite expectations and can be invertible only when v > m1. 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 NormalWishart prior (required E(beta) = beta_hat and V(beta) = (vm1)^(1)(Sigma_hat kron Omega_hat) where v > m +1), SimsZha (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' NormalWishart prior, only with the construction of the prior covariance matrices as laid out in Sims & Zha (1998)).
Re: Bayesian VAR
Just to have this confirmed: the impulse responses are not accumulated, correct?

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 12543
 Joined: Tue Sep 16, 2008 5:38 pm
Re: Bayesian VAR
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
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

 Posts: 1
 Joined: Fri Nov 29, 2013 11:44 am
Forecasting with Models created by BVAR
First of all, thank you for this AddIn.
I am using it to estimate and forecast BVAR with EXOGENOUS variables under the SZ prior. The BVAR 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 BVAR 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 BVAR, 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 BVAR AddIn 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!
I am using it to estimate and forecast BVAR with EXOGENOUS variables under the SZ prior. The BVAR 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 BVAR 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 BVAR, 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 BVAR AddIn 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!
Who is online
Users browsing this forum: No registered users and 5 guests