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

Calculation of WorstIncPrb not robust to correlated income shocks #119

Closed
mnwhite opened this issue Jul 10, 2017 · 6 comments
Closed

Calculation of WorstIncPrb not robust to correlated income shocks #119

mnwhite opened this issue Jul 10, 2017 · 6 comments
Assignees
Labels
Expertise: PhD-Econ Needs knowledge of economics equivalent to second year PhD student Expertise: Prob and Stats Needs ready familiarity with advanced undergraduate multivariate probability and statistics. Tag: PhD Student Exercise Type: Bug
Milestone

Comments

@mnwhite
Copy link
Contributor

mnwhite commented Jul 10, 2017

ConsIndShockModel (and its children) use a calculation of the "worst income shock probability" (CDC denotes with the Weierstrauss p) that is not robust to negative correlation between permanent and transitory shocks. As is, the code looks for the worst permanent shock and worst transitory shock, then finds the probability of both occurring. If the two sets of shocks are negatively correlated, their discretization is unlikely to have such a point, so WorstIncPrb will be 0.0, and MPCmax will be 1.0.

The correct procedure for finding WorstIncPrb is fairly obnoxious: use next period's mNrmMin with the entire set of shocks to get a set of aNrmMin_candidates, choose the greatest one as the actual BoroCnstNat, then sum the probabilities of the shocks that have that aNrmMin_candidate value to get WorstIncPrb.

This hasn't come up so far because the income process has uncorrelated shocks; indeed, we still need to add a function(s) to make correlated discretized RVs.

@compumetrika
Copy link
Contributor

compumetrika commented Jul 20, 2017 via email

@llorracc llorracc added Expertise: Prob and Stats Needs ready familiarity with advanced undergraduate multivariate probability and statistics. and removed PyCon sprints labels Apr 25, 2019
@llorracc
Copy link
Collaborator

I don't really understand this: "If the two sets of shocks are negatively correlated, their discretization is unlikely to have such a point". Unless the transitory and permanent shocks are perfectly correlated, there will always be a worst outcome for the transitory and a worst outcome for the permanent shock, and a positive probability of that event occurring ...

I think maybe the point is that an unpleasant characteristic of the current approach is that the value of the discretized minimum joint point will be strongly affected by the number of gridpoints chosen, which is a serious numerical flaw in the setup.

@mnwhite
Copy link
Contributor Author

mnwhite commented Apr 25, 2019 via email

@llorracc
Copy link
Collaborator

Oh, now I get it, you're right.

There's a parallel alternative to the equiprobable distribution, where there is a fixed set of points, and the way the correlation is introduced is by varying the probability weights for the joint outcomes. For some reason my intuition was about that model instead of the one I've actually used a lot more, which is the equiprobable one.

The solution to this, I think, is the same as for #121 (which is closely related): The boundaries should be set and there should be some very very tiny probability that you actually end up at the bound.

@mnwhite
Copy link
Contributor Author

mnwhite commented Sep 5, 2019

The solution for this (in a more complicated model) is in ConsAggShockModel.py around line 610. Roughly, the procedure here is:

  1. Calc aNrmMin_candidates = PermGroFacPermShkValsNext/Rfree(mNrmMinNext - TranShkValsNext).
  2. Calc aNrmMin as the max of that (the most restrictive one).
  3. Evaluate temp = aNrmMinRfree/(PermGroFacPermShkValsNext) + TranShkValsNext == mNrmMinNext ... Maybe use np.isclose?
  4. Calc WorstIncShkPrb = np.dot(temp, ShkPrbsNext)

Uh, I guess I just wrote most of the code for this. So now this is really, really easy for a first timer.

@MridulS MridulS added this to the 1.0.0 milestone Aug 24, 2020
@MridulS MridulS added Expertise: PhD-Econ Needs knowledge of economics equivalent to second year PhD student Tag: PhD Student Exercise labels Aug 24, 2020
@sbenthall sbenthall modified the milestones: 1.0.0, 1.x.y Dec 10, 2020
@mnwhite
Copy link
Contributor Author

mnwhite commented Jul 3, 2024

This was fixed a while ago, across the various models. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Expertise: PhD-Econ Needs knowledge of economics equivalent to second year PhD student Expertise: Prob and Stats Needs ready familiarity with advanced undergraduate multivariate probability and statistics. Tag: PhD Student Exercise Type: Bug
Projects
Status: Done
Development

No branches or pull requests

6 participants