Skip to content
This repository has been archived by the owner. It is now read-only.

Fix dsge_simulated_theoretical_variance_decomposition.m for non-stationa... #691

Merged
merged 1 commit into from Jul 20, 2015

Conversation

Projects
None yet
3 participants
@JohannesPfeifer
Copy link
Contributor

commented Jul 16, 2014

...ry variables only

If all variables contain unit roots, dsge_simulated_theoretical_variance_decomposition.m crashes because tmp is NaN. Instead, the first draw is now checked for a unit root and a warning is displayed.

Johannes Pfeifer
Fix dsge_simulated_theoretical_variance_decomposition.m for non-stati…
…onary variables only

If all variables contain unit roots, dsge_simulated_theoretical_variance_decomposition.m crashes because tmp is NaN. Instead, the first draw is now checked for a unit root and a warning is displayed.
@stepan-a

This comment has been minimized.

Copy link
Member

commented Jul 30, 2014

@JohannesPfeifer Assuming that my understanding of the issue is correct, I have the feeling that we should rather enter in any routine computing second order moments if all the variables have unit root. So only_non_stationary_vars should be defined sooner.

@JohannesPfeifer

This comment has been minimized.

Copy link
Contributor Author

commented Jul 30, 2014

@stepan-a The issue here was that for all other second moments one gets NaN for unit roots, but the decomposition array was empty. This led to a crash. I agree that defining it sooner would be better. But for now I would prefer this short-term fix, because this seems like a bigger issue and I dislike Dynare crashing without warning for now.

When dealing with this broader issue, we should also think about how to detect this issue in the first place. My check here depends on the first draw. However, it is conceivable that someone has a model where some draws have unit roots and some do not. In this case, we might even want to allow for a NaN matrix for the decomposition, because the percentiles might be well-defined.

Or shall we postpone this issue?

MichelJuillard added a commit that referenced this pull request Jul 20, 2015

Merge pull request #691 from JohannesPfeifer/var_decomp_unit
Fix dsge_simulated_theoretical_variance_decomposition.m for non-stationa...

@MichelJuillard MichelJuillard merged commit 4b3550e into DynareTeam:master Jul 20, 2015

@JohannesPfeifer JohannesPfeifer deleted the JohannesPfeifer:var_decomp_unit branch Jul 20, 2015

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.