![]() |
Birth Generator 3.2.2
Procedural birth date generation for C++23
|
Where the data in resources/ comes from, how it is built, and what the model leaves out. For using the library, see the usage guide.
| Tier | Countries in the files | Generated |
|---|---|---|
lite | 195 independent states | 193: Vatican City and Kosovo have no UN age data |
full | 250 countries and territories | 235: also not the uninhabited or very small territories without UN data (Antarctica, Bouvet Island, Pitcairn, ...) |
A country is generated only when it has an age pyramid and life expectancy. The countries without them are still in countries.tsv, for completeness.
| File | Columns | Source |
|---|---|---|
countries.tsv | cca2, cca3, name, region, subregion, latitude, independent | REST Countries v3.1 |
le_male, le_female | Life expectancy at birth, 2023: UN World Population Prospects 2024 (via the PPgp/wpp2024 R package data) | |
csection_rate | WHO Global Health Observatory, latest year, curated in the script for 107 countries; the others use a subregion or region average, or 0.15 | |
age_pyramid.tsv | m0 … m100, f0 … f100 | Population by single year of age and sex, 1 July 2023 (thousands): UN WPP 2024. 100 is 100 and over |
monthly_births.tsv | jan … dec | A model, not data: 1 + a × cos(2π (m − peak) / 12), peaking in September in the northern hemisphere and March in the southern, with an amplitude a of up to 8% growing with latitude |
scripts/prepare_births.py downloads the sources and writes both tiers:
After changing the data, run make embed to regenerate the compiled-in copy, and update the known-answer tests (the data hash and results change).
csection_rate / 2, at most three times, because scheduled caesareans and inductions fall on weekdays.Each step draws from its own stream split from the call seed, so fixing the sex, the year or an age range does not change the other steps' draws.