Commit 714fee0
Assets grid: subtract MAX_CONSUMPTION margin from the floor
With consumption now declared as `IrregSpacedGrid(n_points=N)` and
points filled at runtime from `geomspace(consumption_floor,
max_consumption, N)`, the grid clusters densely just above
`consumption_floor`. At the lowest-asset / highest-OOP-shock corner,
those near-floor consumption choices push `next_assets =
cash_on_hand - OOP - consumption` slightly below the assets grid's
old lower bound (`0` for the bare model, `-max_annual_labor_income`
when wage_params are available). Out-of-bounds interpolation of
next-period V then injects NaN, which propagates back through E[V]
and eventually fails `validate_V`. Symptom on the production solve:
`Value function at age 93 in regime 'retiree_oamc_forced_forcedout':
7317 of 207360 values are NaN`, with the `[NOTE]` showing E[V] NaN
concentrated at the lowest assets indices and the highest
hcc_transitory shock.
Subtract `MAX_CONSUMPTION` from the assets floor to give a worst-case
single-period drain margin. With 24 linspace points spanning the
wider range, the per-point density change is negligible; the dead
state and the bare-model fallback get the margin too. The asymmetry
fix is the cheapest one — no change to the consumption grid type, no
change to per-iteration parameters, no new constraints.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 31a0ad2 commit 714fee0
1 file changed
Lines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
266 | 278 | | |
267 | | - | |
268 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
269 | 284 | | |
270 | 285 | | |
271 | 286 | | |
| |||
0 commit comments