summary
method for class "epinowcast".
Arguments
- object
A
data.table
output fromepinowcast()
.- type
Character string indicating the summary to return; enforced by
base::match.arg()
. Supported options are:"nowcast" which summarises nowcast posterior with
enw_nowcast_summary()
,"nowcast_samples" which samples latest with
enw_nowcast_samples()
,"fit" which returns the summarised
cmdstanr
fit withenw_posterior()
,"posterior_prediction" which returns summarised posterior predictions for the observations after fitting using
enw_pp_summary()
.
- max_delay
Maximum delay to which nowcasts should be summarised. Must be equal (default) or larger than the modelled maximum delay. If it is larger, then nowcasts for unmodelled dates are added by assuming that case counts beyond the modelled maximum delay are fully observed.
- ...
Additional arguments passed to summary specified by
type
.
See also
summary epinowcast
Other epinowcast:
epinowcast()
,
plot.epinowcast()
Examples
nowcast <- enw_example("nowcast")
# Summarise nowcast posterior
summary(nowcast, type = "nowcast")
#> reference_date report_date .group max_confirm location age_group confirm
#> <IDat> <IDat> <num> <int> <fctr> <fctr> <int>
#> 1: 2021-08-03 2021-08-22 1 149 DE 00+ 149
#> 2: 2021-08-04 2021-08-22 1 166 DE 00+ 166
#> 3: 2021-08-05 2021-08-22 1 133 DE 00+ 133
#> 4: 2021-08-06 2021-08-22 1 137 DE 00+ 137
#> 5: 2021-08-07 2021-08-22 1 139 DE 00+ 139
#> 6: 2021-08-08 2021-08-22 1 97 DE 00+ 97
#> 7: 2021-08-09 2021-08-22 1 58 DE 00+ 58
#> 8: 2021-08-10 2021-08-22 1 175 DE 00+ 175
#> 9: 2021-08-11 2021-08-22 1 233 DE 00+ 233
#> 10: 2021-08-12 2021-08-22 1 237 DE 00+ 237
#> 11: 2021-08-13 2021-08-22 1 204 DE 00+ 204
#> 12: 2021-08-14 2021-08-22 1 189 DE 00+ 189
#> 13: 2021-08-15 2021-08-22 1 125 DE 00+ 125
#> 14: 2021-08-16 2021-08-22 1 98 DE 00+ 98
#> 15: 2021-08-17 2021-08-22 1 242 DE 00+ 242
#> 16: 2021-08-18 2021-08-22 1 223 DE 00+ 223
#> 17: 2021-08-19 2021-08-22 1 202 DE 00+ 202
#> 18: 2021-08-20 2021-08-22 1 171 DE 00+ 171
#> 19: 2021-08-21 2021-08-22 1 112 DE 00+ 112
#> 20: 2021-08-22 2021-08-22 1 45 DE 00+ 45
#> reference_date report_date .group max_confirm location age_group confirm
#> cum_prop_reported delay prop_reported mean median sd mad
#> <num> <num> <num> <num> <num> <num> <num>
#> 1: 1 19 0.000000000 149.000 149 0.000000 0.0000
#> 2: 1 18 0.000000000 167.426 167 1.316912 1.4826
#> 3: 1 17 0.000000000 135.812 136 1.867121 1.4826
#> 4: 1 16 0.000000000 141.255 141 2.341679 2.2239
#> 5: 1 15 0.007194245 145.884 146 3.085460 2.9652
#> 6: 1 14 0.000000000 103.681 103 3.072243 2.9652
#> 7: 1 13 0.000000000 62.762 62 2.461588 1.4826
#> 8: 1 12 0.000000000 185.138 185 3.827742 4.4478
#> 9: 1 11 0.000000000 255.903 255 6.410514 5.9304
#> 10: 1 10 0.004219409 267.488 267 7.975931 7.4130
#> 11: 1 9 0.000000000 236.164 236 8.459235 8.8956
#> 12: 1 8 0.015873016 230.867 230 10.092332 10.3782
#> 13: 1 7 0.040000000 165.026 165 10.254095 10.3782
#> 14: 1 6 0.010204082 129.307 128 8.532969 8.8956
#> 15: 1 5 0.012396694 292.749 292 11.792076 11.8608
#> 16: 1 4 0.017937220 293.296 292 15.992941 14.8260
#> 17: 1 3 0.019801980 291.404 290 19.436887 19.2738
#> 18: 1 2 0.070175439 295.703 292 28.861250 28.1694
#> 19: 1 1 0.383928571 309.456 304 51.295236 47.4432
#> 20: 1 0 1.000000000 381.243 371 103.890978 96.3690
#> cum_prop_reported delay prop_reported mean median sd mad
#> q5 q20 q35 q50 q65 q80 q95 rhat ess_bulk ess_tail
#> <num> <num> <num> <num> <num> <num> <num> <num> <num> <num>
#> 1: 149.00 149.0 149 149 149 149.0 149.00 NA NA NA
#> 2: 166.00 166.0 167 167 168 168.0 170.00 0.9988498 997.2790 946.6047
#> 3: 133.00 134.0 135 136 136 137.0 139.00 0.9997035 1015.7372 1017.4859
#> 4: 138.00 139.0 140 141 142 143.0 145.00 1.0017705 901.5890 958.7197
#> 5: 141.00 143.0 144 146 147 148.0 151.05 0.9984520 1097.0842 1044.2543
#> 6: 99.00 101.0 102 103 105 106.0 109.00 0.9997410 1034.2365 913.6061
#> 7: 59.00 61.0 62 62 63 65.0 67.00 0.9987681 1012.1885 904.7496
#> 8: 180.00 182.0 183 185 186 188.0 192.00 1.0064762 885.6025 907.2186
#> 9: 246.00 250.0 253 255 258 261.0 267.00 1.0014583 933.4472 918.6322
#> 10: 255.00 261.0 264 267 270 274.0 281.00 1.0052639 1044.4533 1055.2781
#> 11: 223.00 229.0 232 236 239 243.0 252.00 1.0041063 1039.8102 897.5389
#> 12: 216.00 222.0 226 230 234 239.0 249.00 1.0026046 1018.9795 919.8161
#> 13: 149.95 156.8 160 165 168 173.0 183.00 0.9991933 1090.1636 782.0808
#> 14: 116.00 122.0 126 128 132 136.0 144.05 1.0000500 1023.7823 888.2873
#> 15: 275.00 283.0 288 292 297 303.0 313.00 0.9993709 1145.8224 968.8335
#> 16: 270.00 280.0 286 292 298 306.0 320.00 1.0008511 1056.0595 914.9342
#> 17: 263.00 274.0 284 290 298 306.0 325.00 0.9992936 1248.9469 968.8798
#> 18: 254.95 271.0 282 292 304 319.0 348.00 1.0008356 1412.5892 1036.8252
#> 19: 237.00 266.8 285 304 323 349.0 406.00 0.9988372 1195.0907 985.8485
#> 20: 240.85 293.8 332 371 405 459.2 569.05 0.9993392 1349.1168 1029.2555
#> q5 q20 q35 q50 q65 q80 q95 rhat ess_bulk ess_tail
# Nowcast posterior samples
summary(nowcast, type = "nowcast_samples")
#> reference_date report_date .group max_confirm location age_group confirm
#> <IDat> <IDat> <num> <int> <fctr> <fctr> <int>
#> 1: 2021-08-03 2021-08-22 1 149 DE 00+ 149
#> 2: 2021-08-03 2021-08-22 1 149 DE 00+ 149
#> 3: 2021-08-03 2021-08-22 1 149 DE 00+ 149
#> 4: 2021-08-03 2021-08-22 1 149 DE 00+ 149
#> 5: 2021-08-03 2021-08-22 1 149 DE 00+ 149
#> ---
#> 19996: 2021-08-22 2021-08-22 1 45 DE 00+ 45
#> 19997: 2021-08-22 2021-08-22 1 45 DE 00+ 45
#> 19998: 2021-08-22 2021-08-22 1 45 DE 00+ 45
#> 19999: 2021-08-22 2021-08-22 1 45 DE 00+ 45
#> 20000: 2021-08-22 2021-08-22 1 45 DE 00+ 45
#> cum_prop_reported delay prop_reported .chain .iteration .draw sample
#> <num> <num> <num> <int> <int> <int> <num>
#> 1: 1 19 0 1 1 1 149
#> 2: 1 19 0 1 2 2 149
#> 3: 1 19 0 1 3 3 149
#> 4: 1 19 0 1 4 4 149
#> 5: 1 19 0 1 5 5 149
#> ---
#> 19996: 1 0 1 2 496 996 232
#> 19997: 1 0 1 2 497 997 470
#> 19998: 1 0 1 2 498 998 343
#> 19999: 1 0 1 2 499 999 436
#> 20000: 1 0 1 2 500 1000 295
# Nowcast model fit
summary(nowcast, type = "fit")
#> variable mean median sd mad
#> <char> <num> <num> <num> <num>
#> 1: lp__ -1374.3525400 -1374.0950000 7.1009648 7.2721530
#> 2: expr_lelatent_int[1,1] 4.1885861 4.1918800 0.1738342 0.1710105
#> 3: expr_beta[1] 0.2846248 0.2950950 0.5786645 0.5786297
#> 4: expr_beta[2] -0.2982401 -0.3058425 0.5611535 0.5248785
#> 5: expr_beta[3] -0.8032542 -0.7860690 0.5592632 0.5652835
#> ---
#> 852: pp_inf_obs[16,1] 293.2960000 292.0000000 15.9929409 14.8260000
#> 853: pp_inf_obs[17,1] 291.4040000 290.0000000 19.4368870 19.2738000
#> 854: pp_inf_obs[18,1] 295.7030000 292.0000000 28.8612502 28.1694000
#> 855: pp_inf_obs[19,1] 309.4560000 304.0000000 51.2952363 47.4432000
#> 856: pp_inf_obs[20,1] 381.2430000 371.0000000 103.8909779 96.3690000
#> q5 q20 q80 q95 rhat ess_bulk
#> <num> <num> <num> <num> <num> <num>
#> 1: -1386.2875000 -1380.1600000 -1368.1580000 -1363.866500 1.0058262 262.7601
#> 2: 3.8995390 4.0461980 4.3313800 4.467335 1.0125766 1290.3349
#> 3: -0.6218335 -0.2326572 0.7502220 1.248866 1.0012756 1404.7190
#> 4: -1.2319820 -0.7325690 0.1550816 0.634257 1.0002675 1539.8589
#> 5: -1.7333510 -1.2830000 -0.3354522 0.079845 1.0039448 1380.2039
#> ---
#> 852: 270.0000000 280.0000000 306.0000000 320.000000 1.0008511 1056.0595
#> 853: 263.0000000 274.0000000 306.0000000 325.000000 0.9992936 1248.9469
#> 854: 254.9500000 271.0000000 319.0000000 348.000000 1.0008356 1412.5892
#> 855: 237.0000000 266.8000000 349.0000000 406.000000 0.9988372 1195.0907
#> 856: 240.8500000 293.8000000 459.2000000 569.050000 0.9993392 1349.1168
#> ess_tail
#> <num>
#> 1: 446.8772
#> 2: 845.7893
#> 3: 856.3218
#> 4: 702.7720
#> 5: 862.2779
#> ---
#> 852: 914.9342
#> 853: 968.8798
#> 854: 1036.8252
#> 855: 985.8485
#> 856: 1029.2555
# Posterior predictions
summary(nowcast, type = "posterior_prediction")
#> reference_date report_date .group max_confirm location age_group confirm
#> <IDat> <IDat> <num> <int> <fctr> <fctr> <int>
#> 1: 2021-07-13 2021-07-13 1 59 DE 00+ 21
#> 2: 2021-07-13 2021-07-14 1 59 DE 00+ 33
#> 3: 2021-07-13 2021-07-15 1 59 DE 00+ 36
#> 4: 2021-07-13 2021-07-16 1 59 DE 00+ 40
#> 5: 2021-07-13 2021-07-17 1 59 DE 00+ 43
#> ---
#> 626: 2021-08-20 2021-08-21 1 171 DE 00+ 159
#> 627: 2021-08-20 2021-08-22 1 171 DE 00+ 171
#> 628: 2021-08-21 2021-08-21 1 112 DE 00+ 69
#> 629: 2021-08-21 2021-08-22 1 112 DE 00+ 112
#> 630: 2021-08-22 2021-08-22 1 45 DE 00+ 45
#> cum_prop_reported delay new_confirm prop_reported mean median sd
#> <num> <num> <int> <num> <num> <num> <num>
#> 1: 0.3559322 0 21 0.35593220 19.818 18 8.997768
#> 2: 0.5593220 1 12 0.20338983 20.808 19 9.249903
#> 3: 0.6101695 2 3 0.05084746 5.894 5 3.385887
#> 4: 0.6779661 3 4 0.06779661 4.209 4 2.753707
#> 5: 0.7288136 4 3 0.05084746 2.454 2 1.870664
#> ---
#> 626: 0.9298246 1 61 0.35672515 80.300 75 34.009714
#> 627: 1.0000000 2 12 0.07017544 12.721 12 6.182182
#> 628: 0.6160714 0 69 0.61607143 75.275 71 32.177737
#> 629: 1.0000000 1 43 0.38392857 47.607 45 21.042085
#> 630: 1.0000000 0 45 1.00000000 40.819 38 19.833043
#> mad q5 q20 q35 q50 q65 q80 q95 rhat ess_bulk
#> <num> <num> <num> <num> <num> <num> <num> <num> <num> <num>
#> 1: 8.8956 8 12 15 18 22 27 36.0 1.0019355 1061.4434
#> 2: 8.8956 8 13 16 19 23 28 38.0 1.0042792 666.2820
#> 3: 2.9652 1 3 4 5 7 8 12.0 1.0005725 1045.8014
#> 4: 2.9652 1 2 3 4 5 6 9.0 0.9990272 883.7513
#> 5: 1.4826 0 1 1 2 3 4 6.0 0.9998082 968.8058
#> ---
#> 626: 31.1346 36 52 63 75 87 107 144.1 1.0054516 1084.5743
#> 627: 5.9304 4 8 10 12 14 17 24.0 1.0001721 1002.8719
#> 628: 29.6520 32 49 59 71 82 100 137.0 1.0006111 1053.0376
#> 629: 19.2738 19 30 38 45 52 64 86.0 1.0053457 947.7744
#> 630: 17.7912 16 25 31 38 45 55 76.0 0.9990299 1049.2785
#> ess_tail
#> <num>
#> 1: 992.3891
#> 2: 963.7879
#> 3: 911.8297
#> 4: 983.1110
#> 5: 951.5574
#> ---
#> 626: 947.1035
#> 627: 967.7479
#> 628: 977.8959
#> 629: 832.7111
#> 630: 994.5472