Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run more than one exogenous variable #46

Open
hlcny opened this issue Aug 25, 2023 · 5 comments
Open

Unable to run more than one exogenous variable #46

hlcny opened this issue Aug 25, 2023 · 5 comments

Comments

@hlcny
Copy link

hlcny commented Aug 25, 2023

Hi,
I am running a BVAR and am attempting to include more than one exogenous variable. With the exact same "opts" variable I am able to run my model with all endogenous variables. When I then include one exogenous variable (e.g., oil supply) it runs fine, when I include another exogenous variable (e.g., global supply chains) it runs fine, but when I attempt to include them both at the same time it fails. This happens with all exogenous variables I've attempted, when trying to include more than one (e.g., oil supply and a GFC dummy variable). I don't believe this is a data issues, as each variable I've tried runs fine by itself.

The code seems to run fine, up until it crashes with these errors:

Index in position 1 exceeds array bounds.

Error in bear.hd_new_for_signres (line 127)
value = hd_estimates2{ii,jj}(1,kk);

Error in bear.hdecomp_inc_exo (line 64)
[hd_estimates]=bear.hd_new_for_signres(const,exo,beta,k,n,p,D,m,T,X,Y,data_exo,IRFt,labels);

Error in BEARmain (line 1061)
[hd_record,favar]=bear.hdecomp_inc_exo(beta_gibbs,D_record,opts.It,opts.Bu,Y,X,n,m,p,k,T,data_exo,exo,endo,const,IRFt,strctident,favar);

Thanks for any advice on a fix!
Hunter Clark, International Research Department, FRBNY

@sabaNdanladi
Copy link

sabaNdanladi commented Aug 25, 2023 via email

@sabaNdanladi
Copy link

sabaNdanladi commented Aug 25, 2023 via email

@hlcny
Copy link
Author

hlcny commented Aug 25, 2023

Updating my original post: after walking through the code and looking at the errors, it appears that the bug, at least in my use case, can be isolated to the historical decomposition section. With the exact same opts variable that does not run with more than one exogenous variable, setting the HD variable to zero allows the code to run to completion without error. So the only workaround in my current use case is to bipass the hd section by setting it to "off".

Additional comment: as per a request on how to implement this workaround: if you are setting up a model using the BEAR interface, on the page "APPLICATIONS", be sure the switch under "Application options" for "Historical decompositions" is set to "No". However, probably the easiest way to implement this if you already have an "opts" BVARsettings configuration variable set up, but which has failed due to more than one exogenous variable, is to double click on the opts variable in your workspace, look for the property "HD" and manually set it to zero. Then run BEARmain(opts). [Note: the opts variable is the variable that is constructed by the BEAR interface when you click on "Quick Export to Workspace"].

@sabaNdanladi
Copy link

sabaNdanladi commented Aug 25, 2023 via email

@sabaNdanladi
Copy link

sabaNdanladi commented Aug 25, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants