summary method for class "epinowcast".
Arguments
- object
A
data.tableoutput 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
cmdstanrfit 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, in units of the timestep used during preprocessing. 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 0.000000 0.0000
#> 2: 1 18 0.000000000 167.480 167.0 1.403414 1.4826
#> 3: 1 17 0.000000000 135.797 136.0 1.858291 1.4826
#> 4: 1 16 0.000000000 141.272 141.0 2.414507 2.9652
#> 5: 1 15 0.007194245 145.764 145.0 3.070461 2.9652
#> 6: 1 14 0.000000000 103.614 103.0 2.892987 2.9652
#> 7: 1 13 0.000000000 62.838 63.0 2.595475 2.9652
#> 8: 1 12 0.000000000 185.149 185.0 3.655155 2.9652
#> 9: 1 11 0.000000000 256.191 256.0 7.084540 7.4130
#> 10: 1 10 0.004219409 267.189 266.0 8.269563 7.4130
#> 11: 1 9 0.000000000 236.218 235.0 8.635453 8.8956
#> 12: 1 8 0.015873016 230.463 230.0 10.395995 10.3782
#> 13: 1 7 0.040000000 165.184 165.0 9.660925 8.8956
#> 14: 1 6 0.010204082 129.535 129.0 8.499354 8.8956
#> 15: 1 5 0.012396694 293.236 292.0 11.922603 11.8608
#> 16: 1 4 0.017937220 293.392 292.0 15.981231 14.8260
#> 17: 1 3 0.019801980 291.537 290.0 20.271200 20.7564
#> 18: 1 2 0.070175439 295.258 292.5 29.356997 27.4281
#> 19: 1 1 0.383928571 310.440 304.0 50.020660 47.4432
#> 20: 1 0 1.000000000 384.142 368.0 115.713601 97.8516
#> 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 149.00 149.0 149 149.0 149.00 NA NA NA
#> 2: 166.00 166 167.00 167.0 168 168.0 170.00 1.0011717 1032.9494 1005.1434
#> 3: 133.00 134 135.00 136.0 136 137.0 139.00 1.0023790 927.8688 880.2070
#> 4: 138.00 139 140.00 141.0 142 143.0 146.00 0.9997357 1024.0598 943.1194
#> 5: 141.00 143 144.00 145.0 147 148.0 151.00 1.0009523 1192.6161 903.2221
#> 6: 99.00 101 102.00 103.0 105 106.0 109.00 1.0056338 1020.5322 1049.4998
#> 7: 59.00 61 62.00 63.0 64 65.0 68.00 0.9989559 1026.9068 976.3448
#> 8: 180.00 182 183.00 185.0 186 188.0 192.00 1.0008924 874.1838 752.9787
#> 9: 246.00 250 253.00 256.0 258 262.0 269.00 1.0019152 840.3245 950.3159
#> 10: 255.00 260 264.00 266.0 270 274.0 282.00 0.9991677 1046.7181 969.9759
#> 11: 224.00 229 232.00 235.0 239 243.0 252.00 1.0025829 884.3839 943.4474
#> 12: 215.00 222 226.00 230.0 234 239.0 249.00 1.0004028 857.4908 808.3249
#> 13: 150.00 157 161.00 165.0 168 173.0 182.00 1.0063929 942.5139 877.8069
#> 14: 117.00 122 125.00 129.0 132 136.0 144.00 1.0015131 1034.7024 934.5488
#> 15: 276.00 283 288.00 292.0 297 302.0 315.00 1.0036606 886.4727 919.5960
#> 16: 269.00 280 286.00 292.0 299 306.0 321.00 0.9996327 1073.2110 1004.6946
#> 17: 262.00 274 282.00 290.0 298 308.0 327.05 0.9994497 1455.4791 1067.2793
#> 18: 252.00 271 282.00 292.5 304 317.0 350.00 0.9986679 1075.3975 898.2947
#> 19: 238.95 269 287.00 304.0 324 349.0 396.10 0.9996761 1254.5799 923.0215
#> 20: 235.00 288 329.65 368.0 406 462.2 602.00 1.0026839 1616.8851 595.4893
#> 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 453
#> 19997: 1 0 1 2 497 997 274
#> 19998: 1 0 1 2 498 998 250
#> 19999: 1 0 1 2 499 999 432
#> 20000: 1 0 1 2 500 1000 491
# Nowcast model fit
summary(nowcast, type = "fit")
#> variable mean median sd mad
#> <char> <num> <num> <num> <num>
#> 1: lp__ -1342.1526185 -1341.9203500 7.6412418 7.4105537
#> 2: expr_lelatent_int[1,1] 4.3131287 4.3123787 0.1671607 0.1600364
#> 3: expr_beta[1] -0.3623124 -0.3515119 0.5850323 0.6006064
#> 4: expr_beta[2] -0.8195613 -0.8131383 0.5819066 0.5560748
#> 5: expr_beta[3] 0.4661264 0.4954509 0.5655799 0.5622846
#> ---
#> 828: pp_inf_obs[16,1] 293.3920000 292.0000000 15.9812307 14.8260000
#> 829: pp_inf_obs[17,1] 291.5370000 290.0000000 20.2712001 20.7564000
#> 830: pp_inf_obs[18,1] 295.2580000 292.5000000 29.3569969 27.4281000
#> 831: pp_inf_obs[19,1] 310.4400000 304.0000000 50.0206604 47.4432000
#> 832: pp_inf_obs[20,1] 384.1420000 368.0000000 115.7136011 97.8516000
#> q5 q20 q80 q95 rhat
#> <num> <num> <num> <num> <num>
#> 1: -1354.6056450 -1.348156e+03 -1335.8619000 -1329.9947250 1.0049158
#> 2: 4.0221140 4.180943e+00 4.4570597 4.5882174 0.9991704
#> 3: -1.3159711 -8.713397e-01 0.1255573 0.5650805 0.9989587
#> 4: -1.7628072 -1.277935e+00 -0.3512899 0.1031575 1.0012032
#> 5: -0.4949055 -1.216879e-02 0.9360700 1.3583852 1.0007621
#> ---
#> 828: 269.0000000 2.800000e+02 306.0000000 321.0000000 0.9996327
#> 829: 262.0000000 2.740000e+02 308.0000000 327.0500000 0.9994497
#> 830: 252.0000000 2.710000e+02 317.0000000 350.0000000 0.9986679
#> 831: 238.9500000 2.690000e+02 349.0000000 396.1000000 0.9996761
#> 832: 235.0000000 2.880000e+02 462.2000000 602.0000000 1.0026839
#> ess_bulk ess_tail
#> <num> <num>
#> 1: 240.9219 374.9920
#> 2: 1006.7816 735.6759
#> 3: 1034.8155 784.3484
#> 4: 1219.4900 659.5294
#> 5: 1436.5899 628.6754
#> ---
#> 828: 1073.2110 1004.6946
#> 829: 1455.4791 1067.2793
#> 830: 1075.3975 898.2947
#> 831: 1254.5799 923.0215
#> 832: 1616.8851 595.4893
# 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-14 2021-07-14 1 72 DE 00+ 22
#> 2: 2021-07-14 2021-07-15 1 72 DE 00+ 34
#> 3: 2021-07-14 2021-07-16 1 72 DE 00+ 38
#> 4: 2021-07-14 2021-07-17 1 72 DE 00+ 43
#> 5: 2021-07-14 2021-07-18 1 72 DE 00+ 43
#> ---
#> 606: 2021-08-20 2021-08-21 1 171 DE 00+ 159
#> 607: 2021-08-20 2021-08-22 1 171 DE 00+ 171
#> 608: 2021-08-21 2021-08-21 1 112 DE 00+ 69
#> 609: 2021-08-21 2021-08-22 1 112 DE 00+ 112
#> 610: 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.3055556 0 22 0.30555556 22.049 20 10.447476
#> 2: 0.4722222 1 12 0.16666667 22.031 21 10.062370
#> 3: 0.5277778 2 4 0.05555556 7.992 8 4.118361
#> 4: 0.5972222 3 5 0.06944444 4.261 4 2.692978
#> 5: 0.5972222 4 0 0.00000000 1.326 1 1.258295
#> ---
#> 606: 0.9298246 1 61 0.35672515 81.048 77 33.870413
#> 607: 1.0000000 2 12 0.07017544 12.586 11 6.299229
#> 608: 0.6160714 0 69 0.61607143 73.471 69 32.792995
#> 609: 1.0000000 1 43 0.38392857 47.332 44 20.074730
#> 610: 1.0000000 0 45 1.00000000 40.534 37 20.435911
#> 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.00 14 17 20 24.35 30 41.00 1.0007087 981.0605
#> 2: 10.3782 8.00 13 17 21 25.00 30 40.00 1.0006400 1010.0549
#> 3: 4.4478 2.00 4 6 8 9.00 11 16.00 1.0018374 1046.7610
#> 4: 2.9652 1.00 2 3 4 5.00 6 9.00 1.0008338 959.7921
#> 5: 1.4826 0.00 0 1 1 2.00 2 4.00 1.0003294 999.1432
#> ---
#> 606: 31.1346 36.95 52 65 77 90.00 105 143.00 0.9999674 1016.8230
#> 607: 5.9304 4.00 7 10 11 14.00 17 24.00 1.0006309 965.7202
#> 608: 29.6520 31.00 46 57 69 80.00 95 133.00 0.9983329 1072.1422
#> 609: 19.2738 20.00 31 37 44 53.00 63 84.00 0.9993679 1127.5257
#> 610: 17.7912 15.00 24 30 37 45.00 54 81.05 1.0003136 1372.2704
#> ess_tail
#> <num>
#> 1: 957.4820
#> 2: 860.7285
#> 3: 956.3804
#> 4: 978.0414
#> 5: 873.2038
#> ---
#> 606: 1000.9385
#> 607: 850.5506
#> 608: 973.6582
#> 609: 906.6164
#> 610: 1042.6714
