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

Standardized IRFs cannot be obtained #40

Closed
cristhianlarrahondo opened this issue Jul 18, 2024 · 3 comments
Closed

Standardized IRFs cannot be obtained #40

cristhianlarrahondo opened this issue Jul 18, 2024 · 3 comments
Assignees

Comments

@cristhianlarrahondo
Copy link

In the example of the Replication of the results by Arias, Rubio-Ramírez, & Waggoner (2018) and in any other case, when setting the standardise argument to TRUE in the compute_impulse_responses() function you get this error if you try to plot the respective irf object:

Error in quantile.default(newX[, i], ...) :
missing values and NaN's not allowed if 'na.rm' is FALSE

@donotdespair
Copy link
Member

Great! Thanks @cristhianlarrahondo

We're on it before we submit the package to CRAN!

Cheers, Tomasz @donotdespair

@donotdespair
Copy link
Member

Hey @cristhianlarrahondo

I investigated this issue and it's very simple. In this example, you set up an identifying zero restriction for element(1,1) of the impulse response on impact in the estimated model. But when you compute standardized IRFs you are standardising each of the column of the IRFs by dividing by the element on the main diagonal of the on-impact impulse response. So, in this example we're dividing by zero that that we set as a restriction. For instance, after computing standardised IFRs, you can run irf[1,1,,] which will give NaNs (the effect of division of zero by zero). If you run irf[2,1,,] then you'll get Inf (the effect of division by zeor). But then, the plot function doesn't like the NaNs, and so it crashes.

Cheers, T

@donotdespair
Copy link
Member

OK, @cristhianlarrahondo

We have implemented the changes and now, the restrictions for IRFs will be checked before the standardisation is allowed. And when there are zeros on the main diagonal, no standardisation is allowed.

Thank you so much for sharing your insights! We, with @adamwang15, really appreciate this!

Greetings,

T

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

No branches or pull requests

2 participants