HARK
HARK copied to clipboard
[WIP] t-indexed inputs for lifecycle models
Building on #1039, this PR is (yet another) attempt to fix #1022.
This PR focuses only on lifecycle models, where AgentType.cycles == 1.
It currently has PerfectForesight models working.
It is currently work in progress. I need help figuring something out.
The next model to crack is the IndShockConsumerType model.
Many of the tests are broken, but I'm going to have to assume that especially in the simulation code this is unavoidable given the new parameterization. Where the numbers are within the right ballpark I've just adjusted test targets.
However, this test in particular is failing in a way that suggests something deeper is wrong. I don't understand why the MPC should be so off from its original target:
self = <HARK.ConsumptionSaving.tests.test_IndShockConsumerType.testIndShockConsumerType testMethod=test_simulated_values>
def test_simulated_values(self):
self.agent.initialize_sim()
self.agent.simulate()
## uses simulated values -- needs simulation code update.
> self.assertAlmostEqual(self.agent.MPCnow[1], 0.5711503906043797)
E AssertionError: 1.0 != 0.5711503906043797 within 7 places
Any thoughts?
- [ ] Tests for new functionality/models or Tests to reproduce the bug-fix in code.
- [ ] Updated documentation of features that add new functionality.
- [ ] Update CHANGELOG.md with major/minor changes.