Skip to content

Commit b8db85c

Browse files
committed
more docs
1 parent c66913d commit b8db85c

File tree

6 files changed

+64
-12
lines changed

6 files changed

+64
-12
lines changed

configuration/demos_config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ modules = [
1313
"birth",
1414
"education",
1515
"household_rebalancing",
16-
"update_income"
16+
"income_adjustment"
1717
]
1818
output_tables = [
1919
"persons",

demos/models/income_adjustment.py

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,38 @@
66
import time
77
from logging_logic import log_execution_time
88

9+
STEP_NAME = "income_adjustment"
910

10-
@orca.step("update_income")
11-
def update_income(persons, households, income_rates, year):
11+
@orca.step(STEP_NAME)
12+
def income_adjustment(persons, households, income_rates, year):
1213
"""
13-
Updating income for persons and households
14+
Update person-level earnings based on county-specific income growth rates.
1415
15-
Args:
16-
persons (DataFrameWrapper): DataFrameWrapper of persons table
17-
households (DataFrameWrapper): DataFrameWrapper of households table
18-
year (int): simulation year
16+
This step applies multiplicative adjustments to person earnings using annual
17+
growth rates that vary by county. It maintains geographic variation in income
18+
trajectories while updating the entire population simultaneously.
19+
20+
Parameters
21+
----------
22+
persons : orca.Table
23+
The persons table containing individual-level attributes including earnings.
24+
households : orca.Table
25+
The households table containing household-level attributes including county ID.
26+
income_rates : orca.Table
27+
Table with annual income growth rates by county.
28+
year : int
29+
The current simulation year.
30+
31+
Returns
32+
-------
33+
None
34+
35+
Notes
36+
-----
37+
- Modifies `persons.earning` in place using multiplicative adjustment.
38+
- Requires `income_rates` table with columns: year, lcm_county_id, rate.
39+
- All persons in the same county receive the same proportional adjustment.
40+
- Rate of 0.05 means 5% growth (earnings multiplied by 1.05).
1941
"""
2042
start_time = time.time()
2143
# TODO: CountyID is not being updated by default

demos/models/rebalancing.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ def household_rebalancing(households, persons, year, get_new_households, get_new
107107
new_person_rows = new_person_rows.merge(hh_mapping, left_on="household_id", right_on="orig_hh")
108108
new_person_rows["household_id"] = new_person_rows["new_hh"]
109109
new_person_rows.drop(["orig_hh", "new_hh"], inplace=True, axis=1)
110-
# new_person_rows.household_id = new_person_rows.household_id.map(dict(zip(to_duplicate_hh, new_hh_ids)))
111110
new_person_rows.index = get_new_person_id(len(new_person_rows))
112111
households.local.loc[new_hh_ids] = new_hh_rows
113112
persons.local = pd.concat([persons.local, new_person_rows])

docs/source/api/income_module.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Income Adjustment Module
2+
============================
3+
4+
This module updates person-level earnings based on county-specific income growth rates.
5+
It applies annual adjustment factors to maintain realistic income trajectories over time,
6+
accounting for geographic variation in economic conditions. The module reads rate data
7+
from an external table and applies multiplicative adjustments to current earnings.
8+
9+
Key features:
10+
11+
- Applies county-specific income growth rates to person earnings.
12+
- Updates earnings multiplicatively based on annual rate data.
13+
- Maintains geographic variation in income growth patterns.
14+
- Simple, direct adjustment without complex modeling.
15+
16+
Caveats:
17+
18+
- Requires an `income_rates` table with columns: year, lcm_county_id, rate.
19+
- Assumes households table has `lcm_county_id` column for geographic mapping.
20+
- All persons in the same county receive the same proportional adjustment.
21+
- No validation of rate values; extreme rates could produce unrealistic results.
22+
- Designed for use as-is; users should ensure rate data is reasonable and complete.
23+
24+
Module function
25+
---------------
26+
27+
This module does not have configuration options
28+
29+
.. autofunction:: demos.models.income_adjustment.income_adjustment

docs/source/api/modules.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ DEMOS Modules
1111
kids_move_module
1212
mortality_module
1313
birth_module
14-
education_module
14+
education_module
15+
rebalancing_module
16+
income_module

docs/source/pages/intro.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ The `modules` parameter accepts a list of strings identifying the modules. By de
116116
```
117117
modules = [
118118
"aging",
119-
"education_model",
119+
"education",
120120
]
121121
```
122122

123123
### Configuration of calibration procedures:
124124

125-
Certain modules support calibration of the simulation to observed values. Specific calibration parameters can be set for each module that supports it. If no configuration is provided, calibration is not performed. Additionally, some modules (namely `employment` and `household_reorganization`) implement simultaneous calibration. While the `employment` module implements both types of calibration, only one of the two can be used. An error will be raised if two types of calibration are defined.
125+
Certain modules support calibration of the simulation output to observed values. Specific calibration parameters can be set for each module that supports it. If no configuration is provided, calibration is not performed. Additionally, some modules (namely `employment` and `household_reorganization`) implement simultaneous calibration. While the `employment` module implements both types of calibration, only one of the two can be used. An error will be raised if two types of calibration are defined.
126126

127127
Calibration configuration is defined at `module-level-config.calibration_procedure` (`module-level-config` is defined differently for every module. The options are displayed [here](../api/configuration_module.rst) and in each module's documentation). We will use the `employment` module as an example.
128128

0 commit comments

Comments
 (0)