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

# Rotation matrices #51

Open
giannilmbd opened this issue Nov 6, 2024 · 11 comments
Open

# Rotation matrices #51

giannilmbd opened this issue Nov 6, 2024 · 11 comments
Assignees

Comments

@giannilmbd
Copy link

It is not clear to me how the rotation matrices (Qs) are drawn and stored. In the documentation (pdf) I cannot find the referred to in the estimation command, yet the estimation algorithm suggests that Q are drawn until eg the sign restriction is satisfied. Also it seems to me that Q is NxNxS, so as many Qs as posterior draws.

Should we not draw several Qs for each posterior draw and retain the whole set that satisfied the identifying restrictions? Or have I misunderstood the documentation?

Thanks
Gianni

@donotdespair
Copy link
Member

Hi @giannilmbd

Thanks for reaching out! Yes, indeed, there's a lot that is happenning here and we need to be clearer on this in the documentation. The changes are coming up!

To address your questions....

  1. In the estimation output we provide the draws for parameters $A$, $\Sigma$ and $Q$ sampled from Normal-Wishart-Haar representation. They are used to compute the parameters of the Structural model $A$ and $B$, where the autoregressive matrix $A$ is the same, that we also provide in th estimation output.
  2. Yes, there's a $Q$ sampled for each $A$ and $\Sigma$ and provided in the output. But indeed in th default setup the max_tries argument of the specify_bsvarSIGN$new() function is set to Inf, which means that $Q$ is sampled as long as the right one is found.
  3. To set the algorithms such that only one $Q$ is sampled for each draw of $A$ and $\Sigma$, and subsequently all of these are accepted or rejected you need to set max_tries = 1

Does this help?

Please, let us know @giannilmbd

Cheers, T

@donotdespair
Copy link
Member

donotdespair commented Nov 10, 2024

Hey @adamwang15

Could you please:

  • revise my answer above and confirm if it's correct and addresses the questions,
  • consider setting the default value max_tries = 1 as this is the setuo for well-specified posterior for $Q$
  • consider extending the vignette by including such considerations before issued in the new version of the package

Thanks!

Cheers, T @donotdespair

@adamwang15
Copy link
Collaborator

adamwang15 commented Nov 11, 2024

Hi @donotdespair and @giannilmbd

Yes, in the current default setting, max_tries is set to Inf indicating that given one draw of $(A,\Sigma)$ the algorithm will keep sampling $Q$ until it finds one that satisfies all the restrictions. This is purely to speed up the algorithm (more effective samples), changing the argument in specify_bsvarSIGN$new() to max_tries = 1 gives you the original algorithm in Antolín-Díaz & Rubio-Ramírez (2018) and Arias, Rubio-Ramírez & Waggoner (2018).

No problem, I will update the default setting and the vignette in the next version!

Cheers,
Adam

@giannilmbd
Copy link
Author

Dear all,

I'm not sure I fully understand (my personal max iter might well be inf too).

I think that for each posterior draw, there might be L acceptable Qs.

For example at the posterior mode, there are possibly several Qs (eg L of these) such that the restrictions are satisfied.

So, while there should be S reduced form matrices A, there should be S \times L Q matrices. Right?

@donotdespair
Copy link
Member

Ah, I see, @giannilmbd!

This package does not allow more draws of $Q$ than those of other parameters, like $A$ and $\Sigma$. It's always that S of them are returned. Now the package allows two estimation procedures:

  1. For each draw of $A$ and $\Sigma$ try just one $Q$, and accept or reject all the parameters at once. This is recommended by the original authors bc in such a case $Q$ is drawn from a distribution conditioned on the restrictions only.
  2. For each draw of $A$ and $\Sigma$ sample different $Q$s as long as you find one that satisfies the sign restrictions. This one is faster but Arias, Rubio-Ramírez & Waggoner (2018), criticise this approach for sampling $Q$ from a different distribution, a full conditional posterior that depends on $A$ and $\Sigma$ as well. I am not sure if Rubio-Ramírez mentions this in this particular paper, but he does so in one of them, and I think it was this one.

We do not allow many draws of $Q$ to be returned for a single draw of $A$ and $\Sigma$. Would such an option be any useful for you? Why would it be? Let us know.

Greetings,

T

@giannilmbd
Copy link
Author

giannilmbd commented Nov 12, 2024 via email

@donotdespair
Copy link
Member

donotdespair commented Nov 12, 2024

Hey @giannilmbd

The approach you described, with many $Q$s per an estimate of $A$ and $\Sigma$ is often used in frequentist approach, but using it has some consequences to the implied distribution of the IRFs Baumeister & Hamilton (2015).

Our package implements Bayesian approach that facilitates the assessment of uncertainty. You obtain S draws of parameters $Q^{(s)}, A^{(s)}, \Sigma^{(s)}$ or alternatively and equivalently of $A^{(s)}, B^{(s)}$, for S = 1,...,S. Each draw of $Q^{(s)}$ is different. So, you always have as many different draws of $Q$ as those of $A$ and $\Sigma$.

My answers above just point out to two ways of obtaining $Q$ draws depending on the value of argument max_tries . We follow closely the papers mentioned in the package description just to assure such compatibility.

Greetings, T

@giannilmbd
Copy link
Author

giannilmbd commented Nov 12, 2024 via email

@donotdespair
Copy link
Member

donotdespair commented Nov 13, 2024

Hey @giannilmbd

No, it's not that! Apologies if it sounded like that! This issues are communicated in individual sentences from several papers. And we had to read each of them several times to find the connections. But we had to do this to make certain that we knew what we were doing and that our package works and does what we want it to. And this took us quite some time. But we never worked with frequenmtists sign-identified models and at least we did not have to figure out the differences between these approaches and Bayesian. And it seems that practices are quite different.

Please, take my previous post just as a clarification of what we do in the package, and I'll reedit it to get rid of any insinuation.

Could you please upload passages from KL again? Somehow, I can't see them. Thanks!

Again, sincere apologies for the tone. No such insinuations were intended.

Greetings, T

@giannilmbd
Copy link
Author

giannilmbd commented Nov 13, 2024 via email

@donotdespair
Copy link
Member

donotdespair commented Nov 13, 2024

That's right! I am only about to read this one!

I will just add that stats and maths of the two cases of having multiple realisation of $Q$ for a single draw of $A^{(s)}$ and $\Sigma^{(s)}$ (and many draws) is very different from having them for a single value of the maximum likelihood estimator $\hat{A}$ and $\hat{\Sigma}$.

Thank you so much for your diligence! We learn from you a lot!

Greetings, T

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

No branches or pull requests

3 participants