Skip to content

Floor leisure at a small positive value so float32 utility stays finite - #18

Merged
hmgaudecker merged 3 commits into
codex/call-time-simulation-populationfrom
fix/smooth-max-leisure-floor
Sep 26, 2026
Merged

hmgaudecker merged 3 commits into
codex/call-time-simulation-populationfrom
fix/smooth-max-leisure-floor

Conversation

@hmgaudecker

Copy link
Copy Markdown
Member

Leisure is a smooth maximum of available leisure and a floor of 1e-5 of the time endowment, s·logaddexp(F/s, available/s), instead of a softplus that bends to 0⁺.

With leisure allowed to approach zero, some work choices (high hours, bad health, re-entry cost) drove leisure to ~1e-12, and utility and its consumption derivative overflowed float32 to ±inf. With the floor, both are finite in float32 across all preference types, health and labour-supply states, hours, ages 51–71 and the full consumption range, and match a 60-digit reference. Every work choice stays feasible and the map stays smooth; where available leisure exceeds 10% of the endowment, utility moves by less than 1e-7.

Tests: tests/test_leisure_floor.py.

https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW

hmgaudecker and others added 3 commits September 25, 2026 11:42
Leisure is s*logaddexp(F/s, available/s) with F = 1e-5 * time_endowment, so
float32 felicity and its consumption derivative stay finite when work costs
exceed the endowment, while cells away from the floor are unchanged to ~1e-8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW
@hmgaudecker
hmgaudecker marked this pull request as ready for review September 26, 2026 10:27
@hmgaudecker
hmgaudecker merged commit 3bc89f7 into codex/call-time-simulation-population Sep 26, 2026
1 check passed
@hmgaudecker
hmgaudecker deleted the fix/smooth-max-leisure-floor branch September 26, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant