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

Integration Example [WIP] #1434

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AMonninger
Copy link
Collaborator

Example notebook of Constructing End of Period (Marginal) Value Function using Transitionmatrices instead of Expectations.

This example notebook tests the idea of @mnwhite . So far, the two methods do NOT construct the same function. Could @mnwhite check for conceptual/ coding errors?

Please ensure your pull request adheres to the following guidelines:

  • Tests for new functionality/models or Tests to reproduce the bug-fix in code.
  • [x ] Updated documentation of features that add new functionality.
  • Update CHANGELOG.md with major/minor changes.

@mnwhite
Copy link
Contributor

mnwhite commented May 28, 2024

I'll take a look at this later today or early tomorrow.

Made various changes to Adrian's notebook to make the method work as intended. Most of it had to do with selecting the grids properly, with some work on function representation. Should run without issue now.
@mnwhite
Copy link
Contributor

mnwhite commented May 28, 2024

@AMonninger I just pushed a commit that revises the notebook. The method works as intended now, and displays comparisons at the bottom. Important changes that I put in (there might be more):

  • You either need to implement an artificial borrowing constraint OR include a tiny probability of zero income. I put in UnempPrb=1e-10. Without this, the minimum allowable bNrm will vary between the two methods.
  • The mNrmGrid and bNrmGrid had incorrect offsets. This is critical.
  • Small, but helped with debugging: use different grid sizes for b and m so you can verify dimensions
  • Did some variable relabeling to make it more accurate
  • You were post-multiplying, not pre-multiplying
  • Need to use the "pseudo-inverse trick" when representing the interim marginal value function
  • And needs to have a point added at 0 (or fix this to generalize it).

The consumption functions constructed by the two integration methods now match as expected. The one using the new integration method is always a little lower than the old one, especially in the highly concave region of the cFunc. This is because the new method incorporates more uncertainty than the old one: as long as the theoretical probability of getting to some m from some b is positive, it is included in the expectation. That's not the case with a fixed set of integration nodes.

Take a look at the notebook and let me know if you want to meet to discuss. I didn't fix all typos or style issues.

@llorracc
Copy link
Collaborator

llorracc commented May 29, 2024 via email

@AMonninger
Copy link
Collaborator Author

@mnwhite Thank you so much. Those changes are brilliant!
But if I understood you correctly, the method only works without Unemployment Probability (eg no pointmass of the pdf at 0/'IncUnemp'). Is there a way to circumvent that limitation?

@llorracc
Copy link
Collaborator

llorracc commented May 29, 2024 via email

@mnwhite
Copy link
Contributor

mnwhite commented May 29, 2024 via email

@mnwhite
Copy link
Contributor

mnwhite commented Dec 4, 2024

I am going to work on this. We liked it, and then it fell off the map.

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

Successfully merging this pull request may close these issues.

4 participants