DemographicsTemplates
DemographicsTemplatesConstants
Mortality_Rates_Mod30_5yrs_Xval: Mod 30 values closest to the 5 yr age boundaries based on when EMOD actually updates individual mortality rates. The distribution is constant for about 5 years (e.g. values at 0.6 days and 1829.5 days) and linearly interpolated between the 5 yr boundaries.
Source code in emod_api/demographics/DemographicsTemplates.py
21 22 23 24 25 26 27 28 29 30 |
|
FullRisk(demog, description='')
FullRisk puts everyone at 100% risk.
Source code in emod_api/demographics/DemographicsTemplates.py
206 207 208 209 210 211 212 213 214 215 216 217 218 |
|
InitRiskExponential(demog, mean=1.0)
InitRiskExponential puts everyone at somewhere between 0% risk and 100% risk, drawn from Exponential.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mean
|
float
|
Mean of exponential distribution. |
1.0
|
Returns:
Raises:
Source code in emod_api/demographics/DemographicsTemplates.py
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
|
InitRiskLogNormal(demog, mean=0.0, sigma=1.0)
InitRiskLogNormal puts everyone at somewhere between 0% risk and 100% risk, drawn from LogNormal.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mean
|
float
|
Mean of lognormal distribution. |
0.0
|
sigma
|
float
|
Sigma of lognormal distribution. |
1.0
|
Returns:
Raises:
Source code in emod_api/demographics/DemographicsTemplates.py
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
|
InitRiskUniform(demog, min_lim=0, max_lim=1, description='')
InitRiskUniform puts everyone at somewhere between 0% risk and 100% risk, drawn uniformly.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min_lim
|
float
|
Low end of uniform distribution. Must be >=0, <1. |
0
|
max_lim
|
float
|
High end of uniform distribution. Must be >=min, <=1. |
1
|
description
|
str
|
Why were these values chosen? |
''
|
Returns:
Raises:
Source code in emod_api/demographics/DemographicsTemplates.py
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
|
MortalityRateByAge(demog, age_bins, mort_rates)
Set (non-disease) mortality rates by age bins. No checks are done on input arrays.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
age_bins
|
list[float]
|
list of age bins, with ages in years. |
required |
mort_rates
|
list[float]
|
list of mortality rates, where mortality rate is daily probability of dying.. |
required |
Returns:
Source code in emod_api/demographics/DemographicsTemplates.py
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 |
|
NoInitialPrevalence(demog)
NoInitialPrevalence disables initial prevalence; outbreak seeding must be done from an Outbreak intervention (or serialized population).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
demog
|
Demographics
|
Demographics object |
required |
Returns:
Raises:
Source code in emod_api/demographics/DemographicsTemplates.py
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
|
NoRisk()
NoRisk puts everyone at 0 risk.
Source code in emod_api/demographics/DemographicsTemplates.py
196 197 198 199 200 201 202 203 |
|
SimpleSusceptibilityDistribution(demog, meanAgeAtInfection=2.5)
Rough initialization to reduce burn-in and prevent huge outbreaks at sim start.
For ages 0 through 99 the susceptibility distribution is set to an exponential distribution with an average age at infection.
The minimum susceptibility is 2.5% at old ages.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
demog
|
Demographics
|
Demographics object |
required |
meanAgeAtInfection
|
float
|
Rough average age at infection in years. |
2.5
|
Note:
Requires that config.parameters.Susceptibility_Initialization_Distribution_Type=DISTRIBUTION_COMPLEX
Source code in emod_api/demographics/DemographicsTemplates.py
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 |
|
birthrate_multiplier(pop_dat_file, base_year, start_year, max_daily_mort=0.01)
Create a birth rate multiplier from UN World Population data file. Args: pop_dat_file: path to UN World Population data file base_year: Base year/Reference year start_year: Read in the pop_dat_file starting with year 'start_year' max_daily_mort: Maximum daily mortality rate
Returns:
Type | Description |
---|---|
tuple[ndarray, ndarray]
|
bith_rate_multiplier_x, birth_rate_multiplier_y |
Source code in emod_api/demographics/DemographicsTemplates.py
639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 |
|
demographicsBuilder(pop_dat_file, base_year, start_year=1950, max_daily_mort=0.01, mortality_rate_x_values=DemographicsTemplatesConstants.Mortality_Rates_Mod30_5yrs_Xval, years_per_age_bin=5)
Build demographics from UN World Population data. Args: pop_dat_file: path to UN World Population data file base_year: Base year/Reference year start_year: Read in the pop_dat_file starting with year 'start_year' years_per_age_bin: The number of years in one age bin, i.e. in one row of the UN World Population data file max_daily_mort: Maximum daily mortality rate mortality_rate_x_values: The distribution of non-disease mortality for a population.
Returns:
Type | Description |
---|---|
tuple[IndividualAttributes, NodeAttributes]
|
IndividualAttributes, NodeAttributes |
Source code in emod_api/demographics/DemographicsTemplates.py
716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 |
|
get_fert_dist_from_rates(rates)
Create dictionary with DTK-compatible distributions from input vectors of fertility (crude) rates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rates
|
list[float]
|
Array/vector of crude rates for whole population, for a range of years. |
required |
Source code in emod_api/demographics/DemographicsTemplates.py
500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 |
|