From ee0e663ebf99c89f4e33de191c494071b9e61525 Mon Sep 17 00:00:00 2001 From: "Matthew N. White" Date: Mon, 25 Sep 2023 11:26:14 -0400 Subject: [PATCH] Adjustments so that labeled model and tests work ConsLabeledModel inherits from IndShockConsumerType, but doesn't use cFunc as an attribute of solution, so add_stable_points can't be run for it; skip post_solve. Added missing T_cycle length in one example notebook, which was generating an error with check_conditions(). --- HARK/ConsumptionSaving/ConsLabeledModel.py | 3 +++ examples/LifecycleModel/Cycles_tutorial.ipynb | 2 ++ 2 files changed, 5 insertions(+) diff --git a/HARK/ConsumptionSaving/ConsLabeledModel.py b/HARK/ConsumptionSaving/ConsLabeledModel.py index 5b4bf20d3..05f30256d 100644 --- a/HARK/ConsumptionSaving/ConsLabeledModel.py +++ b/HARK/ConsumptionSaving/ConsLabeledModel.py @@ -303,6 +303,9 @@ def update_solution_terminal(self): continuation=None, attrs={"m_nrm_min": 0.0}, # minimum normalized market resources ) + + def post_solve(self): + pass # Do nothing, rather than try to run calc_stable_points class ConsPerfForesightLabeledSolver(ConsIndShockSetup): diff --git a/examples/LifecycleModel/Cycles_tutorial.ipynb b/examples/LifecycleModel/Cycles_tutorial.ipynb index a3952818c..69a609092 100644 --- a/examples/LifecycleModel/Cycles_tutorial.ipynb +++ b/examples/LifecycleModel/Cycles_tutorial.ipynb @@ -90,6 +90,7 @@ " \"DiscFac\": 0.98,\n", " \"LivPrb\": [0.99, 0.98, 0.97, 0.96, 0.95, 0.94, 0.93, 0.92, 0.91, 0.90],\n", " \"PermGroFac\": [1.01, 1.01, 1.01, 1.02, 1.00, 0.99, 0.5, 1.0, 1.0, 1.0],\n", + " \"T_cycle\": 10,\n", " \"cycles\": 1,\n", "}\n", "\n", @@ -175,6 +176,7 @@ " \"LivPrb\": [1.05, 1.1, 0.95, 0.92],\n", " \"PermGroFac\": 4 * [1.0],\n", " \"cycles\": 0,\n", + " \"T_cycle\": 4,\n", "}\n", "\n", "Cyc_agent = PerfForesightConsumerType(**Cyc_dictionary)\n",