feat: derive the baseline diet from FBS by default, make GDD-IA optional#20
Merged
Merged
Conversation
…IA optional The GDD-IA dietary dataset is not yet public, so a default GLADE setup could not run without requesting data from its author. Add an FBS-derived baseline-diet source and make it the default (diet.source: fbs); the GDD-IA pipeline remains available via diet.source: gdd_ia, with its input CSVs required only in that mode (checked early with an actionable error). The FBS source derives per-(country, food-group) intake from the FBS 'Food supply (kcal/capita/day)' element at model-basis energy densities, corrected for consumer waste. Deriving mass from energy sidesteps per-item mass-basis bookkeeping (flour extraction, refuse fractions, carcass-to-retail, milk equivalents): FAO's nutritive factors already net these out, mirroring the GDD-IA dairy convention. Wheat and rice are the only FBS items spanning grain and whole_grains; diet.fbs.whole_grain_shares splits them, with defaults fit to GDD-IA's global whole-grain intake by population-weighted least squares. The kcal-normalisation step is GDD-IA-only: the FBS diet is FAO-energy-consistent by construction, and the cereal residual fix reconstructs its cereal budget from the group totals when whole_grains is GBD-anchored. Calibration artefact sets: the default set is refit against the FBS diet (L1 costs land at the previous centre; food_demand multipliers tighten toward 1, e.g. dairy 1.22-1.31 -> ~1.0); the previous GDD-fit default set is preserved as gdd-ia for GDD-IA configs without health; gbd-anchored is unchanged. Provenance snapshots now record diet.source and drop the inactive source's config block. The GDD-IA path is verified byte-identical on unchanged inputs. Against the GDD-IA diet, the FBS-derived diet correlates at r = 0.7-0.96 for most food groups with a ~+10% energy bias (the known supply-vs-survey gap); FBS-override foods are identical by construction. The largest definitional gap is whole grains, where GDD-IA counts decorticated millet/sorghum as processed grain while the food taxonomy classes them as whole_grains; aligning the GDD-IA ingestion to the taxonomy is left as a follow-up.
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.
The GDD-IA dietary dataset is not yet public, so a default GLADE setup could not run without requesting data from its author. Add an FBS-derived baseline-diet source and make it the default (diet.source: fbs); the GDD-IA pipeline remains available via diet.source: gdd_ia, with its input CSVs required only in that mode (checked early with an actionable error).
The FBS source derives per-(country, food-group) intake from the FBS 'Food supply (kcal/capita/day)' element at model-basis energy densities, corrected for consumer waste. Deriving mass from energy sidesteps per-item mass-basis bookkeeping (flour extraction, refuse fractions, carcass-to-retail, milk equivalents): FAO's nutritive factors already net these out, mirroring the GDD-IA dairy convention. Wheat and rice are the only FBS items spanning grain and whole_grains; diet.fbs.whole_grain_shares splits them, with defaults fit to GDD-IA's global whole-grain intake by population-weighted least squares. The kcal-normalisation step is GDD-IA-only: the FBS diet is FAO-energy-consistent by construction, and the cereal residual fix reconstructs its cereal budget from the group totals when whole_grains is GBD-anchored.
Calibration artefact sets: the default set is refit against the FBS diet (L1 costs land at the previous centre; food_demand multipliers tighten toward 1, e.g. dairy 1.22-1.31 -> ~1.0); the previous GDD-fit default set is preserved as gdd-ia for GDD-IA configs without health; gbd-anchored is unchanged. Provenance snapshots now record diet.source and drop the inactive source's config block.
The GDD-IA path is verified byte-identical on unchanged inputs. Against the GDD-IA diet, the FBS-derived diet correlates at r = 0.7-0.96 for most food groups with a ~+10% energy bias (the known supply-vs-survey gap); FBS-override foods are identical by construction. The largest definitional gap is whole grains, where GDD-IA counts decorticated millet/sorghum as processed grain while the food taxonomy classes them as whole_grains; aligning the GDD-IA ingestion to the taxonomy is left as a follow-up.