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

Linear interpolation error in SolvingMicroDSOP #376

Closed
npalmer-professional opened this issue Jul 26, 2019 · 3 comments
Closed

Linear interpolation error in SolvingMicroDSOP #376

npalmer-professional opened this issue Jul 26, 2019 · 3 comments
Assignees

Comments

@npalmer-professional
Copy link
Contributor

npalmer-professional commented Jul 26, 2019

(Moved from REMARK issue to here)

I've run across an error in the linear interpolator when I'm running the SolvingMicroDSOP replication.

I've uploaded a branch here that has a "clean demonstration" of the error: https://github.com/npalmer-professional/HARK/

... and specifically see this "slice across the objective surface," conducted with the linear interpolator: https://github.com/npalmer-professional/HARK/blob/linear-interpolation-fix/HARK/SolvingMicroDSOPs/Figures/SMMslice.pdf
(here's the [original example] (https://github.com/npalmer-professional/REMARK/blob/interpolation_error_example/REMARKs/SolvingMicroDSOPs/Figures/SMMslice_cubicbool-false.pdf) from REMARK)

You an create this image by running the function "make_contour_slice()" in /HARK/HARK/SolvingMicroDSOPs/Code/StructEstimation.py
(the default parameters will create the figure).

Experimenting on the command line I found that if I pull the parameters at one of those spikes and look at the consumption function using that parameter set, you see how a couple of the consumption functions got a little crazy. (Not included here because haven't cleaned up that code for demonstration).

Funny enough I remember something like this 2 or 3 years ago, I ran across this same error but reversed -- the cubic spline gave the error, while the linear spline didn't. Now it appears to be reversed; If I run the same "slice" for the cubic spline I don't get the problem (but I haven't explored cubic spline over the whole space to see if there are errors elsewhere). @mnwhite I think you worked on that back then and fixed the cubic spline issue, and both cubic and linear were working back then. I think this was all way before the 2.7 -> 3.x conversion for what that is worth in terms of very rough timeline.

Edit: Also potentially important, this only shows up when you allow agents to borrow.

Edit2: looks like I can't add any assignees. I'm looking into this slowly.

@llorracc
Copy link
Collaborator

llorracc commented Oct 3, 2019

@npalmer-professional

Any success in sorting this out?

@sbenthall
Copy link
Contributor

Noting that given
#440 (comment)

this issue will soon be invalid after PR #442

@MridulS
Copy link
Member

MridulS commented Dec 10, 2019

NOTE: open econ-ark/REMARK#11 after closing this one

@MridulS MridulS closed this as completed Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants