-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
Make non-OO consumption-saving solvers #1394
Commits on Mar 5, 2024
-
Adds a non-OO solve_one_period function for the ConsPerfectForesight model. Will do for the other solvers as well. The value function in the PF model isn't right when there's an artificial borrowing constraint (in current HARK). This commit makes it less wrong, but I don't think it's *right* yet.
Configuration menu - View commit details
-
Copy full SHA for 35c63b1 - Browse repository at this point
Copy the full SHA 35c63b1View commit details -
Add simplified based ConsIndShockSolver
Still need to add CubicBool and vFuncBool options.
Configuration menu - View commit details
-
Copy full SHA for 3ed2e45 - Browse repository at this point
Copy the full SHA 3ed2e45View commit details
Commits on Mar 6, 2024
-
Configuration menu - View commit details
-
Copy full SHA for a3b3c78 - Browse repository at this point
Copy the full SHA a3b3c78View commit details -
Configuration menu - View commit details
-
Copy full SHA for a3f3a6c - Browse repository at this point
Copy the full SHA a3f3a6cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 34b7555 - Browse repository at this point
Copy the full SHA 34b7555View commit details -
Add simplified ConsKinkedR solver
This ended up 75 lines longer on net, but it's much easier to understand.
Configuration menu - View commit details
-
Copy full SHA for 3d92dd1 - Browse repository at this point
Copy the full SHA 3d92dd1View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab4b086 - Browse repository at this point
Copy the full SHA ab4b086View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8faf1a1 - Browse repository at this point
Copy the full SHA 8faf1a1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8c4e060 - Browse repository at this point
Copy the full SHA 8c4e060View commit details
Commits on Mar 7, 2024
-
Discrepancy actually due to indexing offset error
Had an off-by-one error in the "coefficient hacking" line, creating a discrepancy in the fourth decimal place. Now fixed,
Configuration menu - View commit details
-
Copy full SHA for f245acb - Browse repository at this point
Copy the full SHA f245acbView commit details
Commits on Mar 8, 2024
-
Made basic ConsPortfolio simplified solver
Matches behavior exactly for the default dictionary. Need to add vFunc functionality, then expand to discretized version. This commit has the new solver commented out in the type init method so as to not create a ton of new failing tests while it's still a WIP.
Configuration menu - View commit details
-
Copy full SHA for 747eeab - Browse repository at this point
Copy the full SHA 747eeabView commit details -
Add vFunc capability to simplified portfolio solver
Have not tested fixed share functionality, but I expect it works.
Configuration menu - View commit details
-
Copy full SHA for 45d645c - Browse repository at this point
Copy the full SHA 45d645cView commit details -
Configuration menu - View commit details
-
Copy full SHA for d9cda03 - Browse repository at this point
Copy the full SHA d9cda03View commit details
Commits on Mar 11, 2024
-
Add discrete choice capability to simplified portfolio solver
Still doesn't handle non-independent shock distributions.
Configuration menu - View commit details
-
Copy full SHA for 830764b - Browse repository at this point
Copy the full SHA 830764bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 264186a - Browse repository at this point
Copy the full SHA 264186aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 936930a - Browse repository at this point
Copy the full SHA 936930aView commit details -
Add simple solver for ConsPrefShock
This is where we really start to see that subfunctions for solvers really should be used, as this is almost entirely a copy-paste from ConsIndShock. The idea behind the OO solver encapsulation wasn't bad, but the resulting code was horrible.
Configuration menu - View commit details
-
Copy full SHA for fb10736 - Browse repository at this point
Copy the full SHA fb10736View commit details -
Configuration menu - View commit details
-
Copy full SHA for f592a98 - Browse repository at this point
Copy the full SHA f592a98View commit details -
Make simple KinkyPrefShock solver
This solver also makes clear that we need encapsulation within solution methods. That will happen after I've "flattened" everything.
Configuration menu - View commit details
-
Copy full SHA for 0dd9ab3 - Browse repository at this point
Copy the full SHA 0dd9ab3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5c6a5a5 - Browse repository at this point
Copy the full SHA 5c6a5a5View commit details
Commits on Mar 12, 2024
-
Make simple solver for ConsMarkovModel
Value function capability has not been set up yet, will do on next commit. The Markov model code is where we see most clearly that the "timing change" will make everything better and easier to read. There's a *lot* of confusing stuff going on due to the fact that both t and t+1 activities are being handled by the period-t solver. Ugly.
Configuration menu - View commit details
-
Copy full SHA for 491a6f6 - Browse repository at this point
Copy the full SHA 491a6f6View commit details -
Fix formatting error and cubic interpolation typo
Forgot to test CubicBool=True on prior commit, but there was only one tiny error, 3 character fix. Began to implement value function, but ran out of time.
Configuration menu - View commit details
-
Copy full SHA for 8d3cc8d - Browse repository at this point
Copy the full SHA 8d3cc8dView commit details
Commits on Mar 13, 2024
-
Added vFunc capability to simple ConsMarkov solver
Also fixed a bug/error in the existing vFunc code that made it incapable of actually solving. The good news is that the new code exactly replicates the old code. The bad news is that something is wrong with the vFunc extrapolation code, identically in both versions. Shouldn't be too hard to fix.
Configuration menu - View commit details
-
Copy full SHA for 00861e6 - Browse repository at this point
Copy the full SHA 00861e6View commit details -
Resolve vFunc bug by suppressing extrapolation limit
The math for the limiting linear function for the pseudo-inverse value function must not be correct, as that's what was causing the vFunc jump. It's been commented out for now. Need to look at whether the cFunc extrapolation code is correct for ConsMarkovModel.
Configuration menu - View commit details
-
Copy full SHA for c6f8fc1 - Browse repository at this point
Copy the full SHA c6f8fc1View commit details -
Configuration menu - View commit details
-
Copy full SHA for ea15b11 - Browse repository at this point
Copy the full SHA ea15b11View commit details -
Add simple solver for WarmGlowBequest
This was very easy, basically a copy-paste of IndShock's simple solver with 3 lines added. Removed all the cubic and vFunc stuff to match current capability.
Configuration menu - View commit details
-
Copy full SHA for 056cbd6 - Browse repository at this point
Copy the full SHA 056cbd6View commit details -
Add simple solver for WarmGlowPortfolioModel
I kept the vFunc and DiscreteShare capability in this solver, and looks like I could/should have left vFunc and CubicBool in the other one. Also found and fixed two bugs/typos in the existing code.
Configuration menu - View commit details
-
Copy full SHA for 1568878 - Browse repository at this point
Copy the full SHA 1568878View commit details -
Configuration menu - View commit details
-
Copy full SHA for 753df28 - Browse repository at this point
Copy the full SHA 753df28View commit details -
Configuration menu - View commit details
-
Copy full SHA for ccbdd76 - Browse repository at this point
Copy the full SHA ccbdd76View commit details
Commits on Mar 14, 2024
-
Add simple solver for ConsGenIncProcess
I've tested it on the PersistentIncomeShock model, and it reproduces the solution exactly. Strangely, it's 5-6x *faster* than the existing code, even though I made this version by "flattening" the old version. That probably means there's a hidden loop of some kind that I (unknowingly) skipped over. Also: I think PersistentShockType doesn't initialize properly with default parameters. I'll look into it.
Configuration menu - View commit details
-
Copy full SHA for f33f16d - Browse repository at this point
Copy the full SHA f33f16dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e014f0 - Browse repository at this point
Copy the full SHA 9e014f0View commit details
Commits on Mar 15, 2024
-
First version of simple ConsRiskyAsset solver
This version *only* has the non-independent distributions code, which turns out to be easier to adapt (when starting from the ConsIndShock solver). I will add the independent distributions version shortly. I also added cubic spline capability, but I'm slightly worried there's a small bug in it. Strangely, my "flat" code is again *much* faster than the current code: 10-12x faster. I have absolutely no idea why. The new non-independent solver is faster than the old independent solver. ALSO: The old independent solver doesn't generate the same solution as the non-independent solver. Some discrepancy is to be expected, but it's bigger than I expected.
Configuration menu - View commit details
-
Copy full SHA for 8b759b4 - Browse repository at this point
Copy the full SHA 8b759b4View commit details -
Value function works for ConsRiskyAsset
It was trying to use broken values before.
Configuration menu - View commit details
-
Copy full SHA for 0a94ca7 - Browse repository at this point
Copy the full SHA 0a94ca7View commit details -
Add independent distribution capability
RiskyAsset simple solver can now handle IndepDstnBool=True. Solution is internally consistent with False version. Existing solver has a discrepancy between solutions. There's also a problem with independent distributions and CubicBool=True, but I'm out of work time today.
Configuration menu - View commit details
-
Copy full SHA for 28afed2 - Browse repository at this point
Copy the full SHA 28afed2View commit details -
Fixed Cubic interpolation issue
There was an errant point at aNrm=0, just had to remove it.
Configuration menu - View commit details
-
Copy full SHA for 1c3b683 - Browse repository at this point
Copy the full SHA 1c3b683View commit details
Commits on Mar 16, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 7b4da9c - Browse repository at this point
Copy the full SHA 7b4da9cView commit details
Commits on Mar 18, 2024
-
Add simple solver for ConsMedShockModel
The "medical shock" model now has a simple solver that replicates behavior of the existing solver. The current OO version's CubicBool capability is broken; it works in the new simple solver, but I haven't fixed it in the OO code. It looks like the tests for this model just make sure that it can run and simulate, but I've verified that the solution reproduces exactly on my own. As with other models, this solver runs faster than before, but not by as much: 0.5-2.5x faster. There are improvements and revisions to this model that should happen, but they're for another branch.
Configuration menu - View commit details
-
Copy full SHA for bbdc412 - Browse repository at this point
Copy the full SHA bbdc412View commit details
Commits on Mar 20, 2024
-
Add vFunc and cubic capability to WarmGlowBequest
I had cut this on a prior commit, but now that I've made other (small) improvements to other models, it seems fine to include it. It's almost entirely a copy-paste from ConsIndShock, as you would expect.
Configuration menu - View commit details
-
Copy full SHA for f275116 - Browse repository at this point
Copy the full SHA f275116View commit details -
Non-independent distributions for ConsPortfolioModel
Last bit of functionality has been added to the simple solver for ConsPortfolioModel: non-independent income and return shocks. Value function differs slightly from legacy code, but that's because the old code does not construct end of period value function correctly (doesn't use CubicInterp).
Configuration menu - View commit details
-
Copy full SHA for a4105a3 - Browse repository at this point
Copy the full SHA a4105a3View commit details -
Configuration menu - View commit details
-
Copy full SHA for cf41a10 - Browse repository at this point
Copy the full SHA cf41a10View commit details -
Configuration menu - View commit details
-
Copy full SHA for 260a3f1 - Browse repository at this point
Copy the full SHA 260a3f1View commit details
Commits on Mar 22, 2024
-
These updates include previously merged branches that didn't get entries. Whoops.
Configuration menu - View commit details
-
Copy full SHA for ccf9c8a - Browse repository at this point
Copy the full SHA ccf9c8aView commit details -
Begin moving OO solvers out of model files
Had to move one very small agent type into its own file. It looks like it's a PortfolioConsumerType with a slightly different solver.
Configuration menu - View commit details
-
Copy full SHA for 561872e - Browse repository at this point
Copy the full SHA 561872eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6f9fc02 - Browse repository at this point
Copy the full SHA 6f9fc02View commit details -
Configuration menu - View commit details
-
Copy full SHA for 20352e6 - Browse repository at this point
Copy the full SHA 20352e6View commit details
Commits on Mar 23, 2024
-
Move more legacy code, fix more imports
I said that this was like untangling rope, but it's more like brushing a badly groomed dog.
Configuration menu - View commit details
-
Copy full SHA for 715f845 - Browse repository at this point
Copy the full SHA 715f845View commit details -
Configuration menu - View commit details
-
Copy full SHA for c0f76bb - Browse repository at this point
Copy the full SHA c0f76bbView commit details -
Remove ConsPortfolioJointDistSolver from tests
This is now handled by the same solver: just set boolean flag and let it run.
Configuration menu - View commit details
-
Copy full SHA for e2c38fb - Browse repository at this point
Copy the full SHA e2c38fbView commit details
Commits on Mar 25, 2024
-
Add simple solver for alternate ConsPortfolio
There used to be a special solver in ConsRiskyAssetModel.py that did the "basic" portfolio model, without discrete choice nor adjustment frictions. A simple solver of that kind has now been added.
Configuration menu - View commit details
-
Copy full SHA for 964894c - Browse repository at this point
Copy the full SHA 964894cView commit details -
Configuration menu - View commit details
-
Copy full SHA for eb96ab7 - Browse repository at this point
Copy the full SHA eb96ab7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 736b424 - Browse repository at this point
Copy the full SHA 736b424View commit details -
Configuration menu - View commit details
-
Copy full SHA for 765be38 - Browse repository at this point
Copy the full SHA 765be38View commit details -
Configuration menu - View commit details
-
Copy full SHA for c1210e2 - Browse repository at this point
Copy the full SHA c1210e2View commit details -
Restore fixed share type to ConsRiskyAssetModel
There is now a "simple solver" for a model in which the risky share is *fixed* (but might vary by age), but is not necessarily 0 or 1. This previously existed, was temporarily exiled to a new file, and now has been restored.
Configuration menu - View commit details
-
Copy full SHA for 27c01ab - Browse repository at this point
Copy the full SHA 27c01abView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4e0436c - Browse repository at this point
Copy the full SHA 4e0436cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 428ddd5 - Browse repository at this point
Copy the full SHA 428ddd5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 18c8f70 - Browse repository at this point
Copy the full SHA 18c8f70View commit details -
Configuration menu - View commit details
-
Copy full SHA for b4583a8 - Browse repository at this point
Copy the full SHA b4583a8View commit details