Skip to content

Commit

Permalink
Adjustments so that labeled model and tests work
Browse files Browse the repository at this point in the history
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().
  • Loading branch information
mnwhite committed Sep 25, 2023
1 parent f92b4f1 commit ee0e663
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions HARK/ConsumptionSaving/ConsLabeledModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 2 additions & 0 deletions examples/LifecycleModel/Cycles_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit ee0e663

Please sign in to comment.