Generate Vectors of Population Growth Scaling (r_C and r_A)
Source:R/aux_functions.R
get_population_scaling.Rd
Computes population multipliers over time for under-5 (r_C) and over-5 (r_A) groups, using fixed daily exponential growth. Time steps can be monthly (30 days) or weekly (7 days).
Usage
get_population_scaling(
n,
month = TRUE,
growth_rate_C = 1.026^(1/360),
growth_rate_A = 1.026^(1/360),
init_r_C = 1,
init_r_A = 1
)
Arguments
- n
Integer. Number of time points to generate (e.g. months or weeks).
- month
Logical. If
TRUE
, use 30-day months; ifFALSE
, use 7-day weeks.- growth_rate_C
Daily growth rate for under-5 population. Default corresponds to 2.6% per year.
- growth_rate_A
Daily growth rate for over-5 population. Default corresponds to 2.6% per year.
- init_r_C
Initial multiplier for r_C (default = 1).
- init_r_A
Initial multiplier for r_A (default = 1).
Examples
# Monthly population growth over 60 months
get_population_scaling(n = 60, month = TRUE)
#> timestep model_days r_C r_A
#> 1 1 0 1.000000 1.000000
#> 2 2 30 1.002141 1.002141
#> 3 3 60 1.004287 1.004287
#> 4 4 90 1.006438 1.006438
#> 5 5 120 1.008593 1.008593
#> 6 6 150 1.010752 1.010752
#> 7 7 180 1.012917 1.012917
#> 8 8 210 1.015086 1.015086
#> 9 9 240 1.017259 1.017259
#> 10 10 270 1.019437 1.019437
#> 11 11 300 1.021620 1.021620
#> 12 12 330 1.023808 1.023808
#> 13 13 360 1.026000 1.026000
#> 14 14 390 1.028197 1.028197
#> 15 15 420 1.030399 1.030399
#> 16 16 450 1.032605 1.032605
#> 17 17 480 1.034816 1.034816
#> 18 18 510 1.037032 1.037032
#> 19 19 540 1.039252 1.039252
#> 20 20 570 1.041478 1.041478
#> 21 21 600 1.043708 1.043708
#> 22 22 630 1.045943 1.045943
#> 23 23 660 1.048182 1.048182
#> 24 24 690 1.050427 1.050427
#> 25 25 720 1.052676 1.052676
#> 26 26 750 1.054930 1.054930
#> 27 27 780 1.057189 1.057189
#> 28 28 810 1.059453 1.059453
#> 29 29 840 1.061721 1.061721
#> 30 30 870 1.063995 1.063995
#> 31 31 900 1.066273 1.066273
#> 32 32 930 1.068556 1.068556
#> 33 33 960 1.070844 1.070844
#> 34 34 990 1.073137 1.073137
#> 35 35 1020 1.075435 1.075435
#> 36 36 1050 1.077738 1.077738
#> 37 37 1080 1.080046 1.080046
#> 38 38 1110 1.082358 1.082358
#> 39 39 1140 1.084676 1.084676
#> 40 40 1170 1.086998 1.086998
#> 41 41 1200 1.089326 1.089326
#> 42 42 1230 1.091659 1.091659
#> 43 43 1260 1.093996 1.093996
#> 44 44 1290 1.096339 1.096339
#> 45 45 1320 1.098686 1.098686
#> 46 46 1350 1.101039 1.101039
#> 47 47 1380 1.103396 1.103396
#> 48 48 1410 1.105759 1.105759
#> 49 49 1440 1.108127 1.108127
#> 50 50 1470 1.110500 1.110500
#> 51 51 1500 1.112877 1.112877
#> 52 52 1530 1.115260 1.115260
#> 53 53 1560 1.117648 1.117648
#> 54 54 1590 1.120042 1.120042
#> 55 55 1620 1.122440 1.122440
#> 56 56 1650 1.124843 1.124843
#> 57 57 1680 1.127252 1.127252
#> 58 58 1710 1.129666 1.129666
#> 59 59 1740 1.132085 1.132085
#> 60 60 1770 1.134509 1.134509
# Weekly population growth over 120 weeks with custom growth rates
get_population_scaling(n = 120, month = FALSE, growth_rate_C = 1.00005, growth_rate_A = 1.00003)
#> timestep model_days r_C r_A
#> 1 1 0 1.000000 1.000000
#> 2 2 7 1.000350 1.000210
#> 3 3 14 1.000700 1.000420
#> 4 4 21 1.001051 1.000630
#> 5 5 28 1.001401 1.000840
#> 6 6 35 1.001751 1.001051
#> 7 7 42 1.002102 1.001261
#> 8 8 49 1.002453 1.001471
#> 9 9 56 1.002804 1.001681
#> 10 10 63 1.003155 1.001892
#> 11 11 70 1.003506 1.002102
#> 12 12 77 1.003857 1.002313
#> 13 13 84 1.004209 1.002523
#> 14 14 91 1.004560 1.002734
#> 15 15 98 1.004912 1.002944
#> 16 16 105 1.005264 1.003155
#> 17 17 112 1.005616 1.003366
#> 18 18 119 1.005968 1.003576
#> 19 19 126 1.006320 1.003787
#> 20 20 133 1.006672 1.003998
#> 21 21 140 1.007024 1.004209
#> 22 22 147 1.007377 1.004420
#> 23 23 154 1.007730 1.004631
#> 24 24 161 1.008082 1.004842
#> 25 25 168 1.008435 1.005053
#> 26 26 175 1.008788 1.005264
#> 27 27 182 1.009141 1.005475
#> 28 28 189 1.009495 1.005686
#> 29 29 196 1.009848 1.005897
#> 30 30 203 1.010201 1.006108
#> 31 31 210 1.010555 1.006320
#> 32 32 217 1.010909 1.006531
#> 33 33 224 1.011263 1.006743
#> 34 34 231 1.011617 1.006954
#> 35 35 238 1.011971 1.007165
#> 36 36 245 1.012325 1.007377
#> 37 37 252 1.012679 1.007589
#> 38 38 259 1.013034 1.007800
#> 39 39 266 1.013389 1.008012
#> 40 40 273 1.013743 1.008224
#> 41 41 280 1.014098 1.008435
#> 42 42 287 1.014453 1.008647
#> 43 43 294 1.014808 1.008859
#> 44 44 301 1.015163 1.009071
#> 45 45 308 1.015519 1.009283
#> 46 46 315 1.015874 1.009495
#> 47 47 322 1.016230 1.009707
#> 48 48 329 1.016586 1.009919
#> 49 49 336 1.016941 1.010131
#> 50 50 343 1.017297 1.010343
#> 51 51 350 1.017654 1.010555
#> 52 52 357 1.018010 1.010767
#> 53 53 364 1.018366 1.010980
#> 54 54 371 1.018723 1.011192
#> 55 55 378 1.019079 1.011404
#> 56 56 385 1.019436 1.011617
#> 57 57 392 1.019793 1.011829
#> 58 58 399 1.020150 1.012042
#> 59 59 406 1.020507 1.012254
#> 60 60 413 1.020864 1.012467
#> 61 61 420 1.021222 1.012680
#> 62 62 427 1.021579 1.012892
#> 63 63 434 1.021937 1.013105
#> 64 64 441 1.022294 1.013318
#> 65 65 448 1.022652 1.013531
#> 66 66 455 1.023010 1.013743
#> 67 67 462 1.023368 1.013956
#> 68 68 469 1.023727 1.014169
#> 69 69 476 1.024085 1.014382
#> 70 70 483 1.024443 1.014595
#> 71 71 490 1.024802 1.014808
#> 72 72 497 1.025161 1.015021
#> 73 73 504 1.025520 1.015235
#> 74 74 511 1.025879 1.015448
#> 75 75 518 1.026238 1.015661
#> 76 76 525 1.026597 1.015874
#> 77 77 532 1.026956 1.016088
#> 78 78 539 1.027316 1.016301
#> 79 79 546 1.027675 1.016515
#> 80 80 553 1.028035 1.016728
#> 81 81 560 1.028395 1.016942
#> 82 82 567 1.028755 1.017155
#> 83 83 574 1.029115 1.017369
#> 84 84 581 1.029475 1.017583
#> 85 85 588 1.029836 1.017796
#> 86 86 595 1.030196 1.018010
#> 87 87 602 1.030557 1.018224
#> 88 88 609 1.030918 1.018438
#> 89 89 616 1.031278 1.018652
#> 90 90 623 1.031639 1.018865
#> 91 91 630 1.032001 1.019079
#> 92 92 637 1.032362 1.019293
#> 93 93 644 1.032723 1.019508
#> 94 94 651 1.033085 1.019722
#> 95 95 658 1.033446 1.019936
#> 96 96 665 1.033808 1.020150
#> 97 97 672 1.034170 1.020364
#> 98 98 679 1.034532 1.020579
#> 99 99 686 1.034894 1.020793
#> 100 100 693 1.035256 1.021007
#> 101 101 700 1.035619 1.021222
#> 102 102 707 1.035981 1.021436
#> 103 103 714 1.036344 1.021651
#> 104 104 721 1.036707 1.021865
#> 105 105 728 1.037070 1.022080
#> 106 106 735 1.037433 1.022295
#> 107 107 742 1.037796 1.022509
#> 108 108 749 1.038159 1.022724
#> 109 109 756 1.038523 1.022939
#> 110 110 763 1.038886 1.023154
#> 111 111 770 1.039250 1.023369
#> 112 112 777 1.039614 1.023583
#> 113 113 784 1.039977 1.023798
#> 114 114 791 1.040341 1.024013
#> 115 115 798 1.040706 1.024228
#> 116 116 805 1.041070 1.024444
#> 117 117 812 1.041434 1.024659
#> 118 118 819 1.041799 1.024874
#> 119 119 826 1.042164 1.025089
#> 120 120 833 1.042528 1.025304