Global Health Policy Simulation model
| Home | Quick Start | User Guide | Schemas | Models | Architecture | Data Model | Developer Guide | Technical docs | API |
| Related: Weight quintile plan | Income quintile factor means plan | FINCH guide | Technical index | Documentation index |
Title: Height CSV Quintile Integration
Overview: Add new male/female height CSV inputs to KevinHall dynamic model parsing while preserving legacy HeightSlope/HeightStdDev fields, then apply height slope/std by adjustment income stratum and keep final output income categories unchanged.
| Status | Item |
|---|---|
| Done | Add optional KevinHall height CSV fields to v1/v2 schemas while preserving legacy HeightSlope/HeightStdDev support. |
| Done | Implement KevinHall parser logic to read slope/std CSVs, validate row counts, and fallback to legacy scalar fields. |
| Done | Update KevinHall runtime/model definition to select height slope/std by income adjustment stratum before final category remap. |
| Done | Add tests for scalar backward compatibility, single-row broadcast, multi-row strata mapping, and invalid row-count errors. |
| Done | Update KevinHall sample dynamic model fixture(s) to show new CSV input format. |
Support new height_female.csv and height_male.csv inputs in KevinHall dynamic model config, with either:
slope, std) broadcast to all adjustment strata, or1..N (N = adjustment_income_stratum_count).Keep existing HeightSlope / HeightStdDev JSON fields working for backward compatibility.
generate_risk_factors)HeightSlope, and sex-specific HeightStdDev.(sex, income_adjustment_stratum):
N rows: use row stratum_index.1 row: broadcast that row to all strata.Height_residual using selected std.Height using selected slope/std and weight power mean.adjustment_income_stratum_count, e.g. 5) for quintile-based height selection.person.income categories from project requirements (3 or 4) as downstream output buckets.update_risk_factors) split by ageage == 0)
0 < age < 19)
update_height) each step.update_height selects stratum-based slope/std before computing height.age >= 19)
adjustment_income_stratum_count = 5 and project_requirements.income.categories = 4:
flowchart TD
runStart[RunStepStart] --> modeCheck{Phase}
modeCheck -->|Generate| initAll[InitNutrientEnergyWeightAll]
modeCheck -->|Update| updateSplit[SplitNewbornVsNonNewborn]
initAll --> weightAdjust[AdjustWeightToExpected]
weightAdjust --> strataAssign[AssignIncomeAdjustmentStrataN]
strataAssign --> heightInit[InitHeightUsingSexAndStratum]
heightInit --> finalIncomeInit[AssignFinalIncomeCategories3Or4]
finalIncomeInit --> bmiInit[ComputeBMI]
updateSplit --> newbornPath[NewbornAge0]
updateSplit --> nonNewbornPath[NonNewbornAgeGT0]
newbornPath --> newbornWeight[InitAndAdjustNewbornWeight]
newbornWeight --> newbornStrata[AssignIncomeAdjustmentStrataN]
newbornStrata --> newbornHeight[InitHeightUsingSexAndStratum]
newbornHeight --> newbornIncome[AssignFinalIncomeCategories3Or4]
newbornIncome --> newbornBmi[ComputeBMI]
nonNewbornPath --> ageGate{AgeL<9}
ageGate -->|Yes| childWeight[UpdateWeightPre19]
ageGate -->|No| adultWeight[RunKevinHallAdultWeight]
childWeight --> childStrata[AssignIncomeAdjustmentStrataN]
childStrata --> childHeight[UpdateHeightUsingSexAndStratum]
childHeight --> childIncome[AssignFinalIncomeCategories3Or4]
childIncome --> childBmi[ComputeBMI]
adultWeight --> adultStrata[AssignIncomeAdjustmentStrataN]
adultStrata --> adultIncome[AssignFinalIncomeCategories3Or4]
adultIncome --> adultBmi[ComputeBMI]
[C:/healthgps/schemas/v2/config/models/kevinhall.json](C:/healthgps/schemas/v2/config/models/kevinhall.json)[C:/healthgps/schemas/v1/config/models/kevinhall.json](C:/healthgps/schemas/v1/config/models/kevinhall.json)HeightCsv.Female / HeightCsv.Male (or final agreed field names) as CSV metadata blocks via existing CSV helpers in [C:/healthgps/src/HealthGPS.Input/model_parser.cpp](C:/healthgps/src/HealthGPS.Input/model_parser.cpp).slope and std (row-order mapping).1 row => broadcast to all adjustment strata.N rows => map row i to stratum i+1.HeightSlope/HeightStdDev scalar values if CSV absent.[C:/healthgps/src/HealthGPS/kevinhall_model.h](C:/healthgps/src/HealthGPS/kevinhall_model.h) and relevant constructor/definition wiring in [C:/healthgps/src/HealthGPS.Input/model_parser.cpp](C:/healthgps/src/HealthGPS.Input/model_parser.cpp).income_adjustment_stratum before final income category remap.
[C:/healthgps/src/HealthGPS/static_linear_model.cpp](C:/healthgps/src/HealthGPS/static_linear_model.cpp) as behavioral reference.generate/update paths), select slope/std by person’s adjustment stratum when available; otherwise use broadcast/scalar defaults.project_requirements.income.categories) unchanged.[C:/healthgps/src/HealthGPS.Tests/KevinHallWeightValidation.Test.cpp](C:/healthgps/src/HealthGPS.Tests/KevinHallWeightValidation.Test.cpp) and related KevinHall input tests.N strata.[C:/healthgps/input-data/data/KevinHall_FINCH/dynamic_model.json](C:/healthgps/input-data/data/KevinHall_FINCH/dynamic_model.json).Income-stratum assignment (static model) feeds which height CSV row/params are used. Height then prints stratum and final-income summary tables on generate (same gating as weight).
![]() |
|---|
| Income-stratum assignment buckets and sampled factor delta/apply rows (initial year) |
![]() |
|---|
| Height stratum assignment and height by final income category (year 2022, phase=generate); weight tables appear in the same log |
Author: Mahima Ghosh