Health-GPS

Logo

Global Health Policy Simulation model

View the Project on GitHub imperialCHEPI/healthgps

Height CSV Quintile Integration Plan

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

Plan summary

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.

Work items

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.

Goal

Support new height_female.csv and height_male.csv inputs in KevinHall dynamic model config, with either:

Keep existing HeightSlope / HeightStdDev JSON fields working for backward compatibility.

Person Lifecycle Walkthrough (with new height quintile logic)

1) Start-of-run initialization (generate_risk_factors)

2) Yearly update (update_risk_factors) split by age

3) 5-strata adjustment with 4-category output (example)

Flowchart

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]

Implementation Steps

Example console output

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 and delta/apply
Income-stratum assignment buckets and sampled factor delta/apply rows (initial year)
Height and weight stratum assignment
Height stratum assignment and height by final income category (year 2022, phase=generate); weight tables appear in the same log

Validation Strategy


Author: Mahima Ghosh