mboeck11 / BGVAR

Toolbox for the estimation of Bayesian Global Vector Autoregressions in R.
27 stars 20 forks source link

Update .getweights in utils.R #3

Closed edoardochiarotti closed 3 years ago

edoardochiarotti commented 3 years ago

Hi Max,

I think Your package currently does not allow to have one variable per entity, one of the reasons being the code in this for loop in .getweights() (in utils). This suggestion here should do the trick. I think it's just a matter of making the one-variable vector as a matrix and keeping the colname, that's why I created the pretemp vector. It's just one way to do it, maybe you'll have better ways. That part works, just it may be that there are other chunks of the code where you'd implement to do this change. I did not go on in finding them, I am sure you can do it much quicker than me. Let me know if you plan to go forward with this and in case you want to discuss further.

Cheers, Edoardo

mboeck11 commented 3 years ago

Hi Edoardo,

thanks for pointing this out - I've noticed this also a few days earlier. I think you've an error in there - where does the object 'usData' comes from? I think it should be just 'Data'. Otherwise the code shouldn't run through, right?

I will check later whether there are other loopholes when just having one variable per entity.

Best, Max

edoardochiarotti commented 3 years ago

Hi Max,

yes sorry my bad, it's "Data" (usData is just a specific one I am using).

Thanks, Edoardo

mboeck11 commented 3 years ago

Thanks!

Let me know whether it works now. I'll run some checks later.

Best, Max

edoardochiarotti commented 3 years ago

Hi Max, thanks. Also there was [1] instead of [jj], I changed that too, now it should be fine. I'll try it out and let you know, thanks, Edoardo

edoardochiarotti commented 3 years ago

Hi Max,

still does not work I am afraid. I tried to debug it but I couldn't. Also, with the development version of the package I am having troubles running the IRFs for the example "irf.chol.us.mp", I get an error like "Error in shockinfo[!duplicated(shockinfo), ] : incorrect number of dimensions" (I don't know what changed there). I'll go back to the CRAN version for now, let me know when you are through with these changes.

Thanks, Edoardo

mboeck11 commented 3 years ago

Hi,

thanks for letting me know. I've just uploaded the new development version two days ago and there are obviously some bugs left.

Best, Max