Report aggregate hours worked (N) in addition to effective labor (L) - #1228
Merged
Merged
Conversation
Closes PSLmodels#709. Aggregate labor L weights each household's hours by its effective-labor-units profile e, so it does not directly map to hours worked when productivity varies across households. This adds an aggregate hours measure N that sums hours without the e weighting: N_t = sum_s sum_j omega_{s,t} lambda_j n_{j,s,t} - aggregates.py: add get_N, mirroring get_L but without the e factor. - SS.py and TPI.py: compute N and add it to the steady-state and transition output dictionaries (both, so the two keep the same keys). Adds test_get_N (SS and TPI) checking the result against an explicit index-by-index loop. With the default normalized e profile N and L coincide at baseline (L = 0.3330, N = 0.3333); they diverge once e is not mean-one, which is the case the separate measure is for.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1228 +/- ##
==========================================
+ Coverage 75.17% 75.20% +0.02%
==========================================
Files 24 24
Lines 6031 6041 +10
==========================================
+ Hits 4534 4543 +9
- Misses 1497 1498 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
jdebacker
approved these changes
Sep 26, 2026
Member
|
@arihantlodha-cmd Thanks for addressing this issue! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Closes #709. Aggregate labor
Lweights each household's hours by its effective-labor-units profilee, so it does not directly map to hours worked when productivity varies across households. This adds an aggregate hours measureNthat sums hours without theeweighting:60528N_t = \sum_s \sum_j \omega_{s,t}\lambda_j n_{j,s,t}60528
Changes
aggregates.py: addget_N, mirroringget_Lbut without theefactor.SS.pyandTPI.py: computeNand add it to the steady-state and transition output dictionaries (both, so the two keep the same keys per Make SS and TPI output dictionaries expose the same keys #1185).Testing
Adds
test_get_N(SS and TPI) checking the result against an explicit index-by-index loop, mirroringtest_get_L. A baseline SS run storesNnext toL: with the default normalizedeprofile they coincide (L = 0.3330, N = 0.3333); they diverge onceeis not mean-one, which is the case this separate measure is for.ruff check/formatclean.