Skip to contents

summary method for class "epinowcast".

Usage

# S3 method for epinowcast
summary(
  object,
  type = c("nowcast", "nowcast_samples", "fit", "posterior_prediction"),
  ...
)

Arguments

object

A data.table output from epinowcast().

type

Character string indicating the summary to return; enforced by base::match.arg(). Supported options are:

...

Additional arguments passed to summary specified by type.

Value

A summary data.frame

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
#>  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
#>     cum_prop_reported delay prop_reported    mean median        sd     mad  q5
#>  1:                 1    19   0.000000000 149.000  149.0  0.000000  0.0000 149
#>  2:                 1    18   0.000000000 167.453  167.0  1.291301  1.4826 166
#>  3:                 1    17   0.000000000 135.677  135.0  1.853674  1.4826 133
#>  4:                 1    16   0.000000000 140.896  141.0  2.169768  2.9652 138
#>  5:                 1    15   0.007194245 145.222  145.0  2.760133  2.9652 141
#>  6:                 1    14   0.000000000 103.248  103.0  2.893591  2.9652  99
#>  7:                 1    13   0.000000000  62.742   62.0  2.412313  2.9652  59
#>  8:                 1    12   0.000000000 185.065  185.0  3.687054  4.4478 180
#>  9:                 1    11   0.000000000 255.574  255.0  6.079925  5.9304 246
#> 10:                 1    10   0.004219409 266.480  266.0  7.480345  7.4130 255
#> 11:                 1     9   0.000000000 235.082  235.0  7.671123  7.4130 224
#> 12:                 1     8   0.015873016 229.150  229.0  9.532280 10.3782 215
#> 13:                 1     7   0.040000000 163.327  163.0  8.941478  8.8956 149
#> 14:                 1     6   0.010204082 130.404  130.0  8.343284  8.8956 118
#> 15:                 1     5   0.012396694 299.890  299.0 12.795923 13.3434 280
#> 16:                 1     4   0.017937220 303.138  301.0 17.375755 17.0499 278
#> 17:                 1     3   0.019801980 311.131  309.0 24.503638 23.7216 275
#> 18:                 1     2   0.070175439 318.522  315.0 34.923992 34.0998 270
#> 19:                 1     1   0.383928571 334.231  327.5 53.967621 51.1497 258
#> 20:                 1     0   1.000000000 322.430  306.0 93.868922 80.8017 198
#>       q20    q35   q50    q65   q80    q95      rhat  ess_bulk  ess_tail
#>  1: 149.0 149.00 149.0 149.00 149.0 149.00        NA        NA        NA
#>  2: 166.0 167.00 167.0 168.00 168.0 170.00 1.0002481  858.3035  887.5883
#>  3: 134.0 135.00 135.0 136.00 137.0 139.00 0.9986872  784.2638  908.5946
#>  4: 139.0 140.00 141.0 142.00 143.0 145.00 0.9999757  986.1909  904.5245
#>  5: 143.0 144.00 145.0 146.00 147.0 150.00 1.0007676  865.5054  947.2221
#>  6: 101.0 102.00 103.0 104.00 106.0 109.00 0.9991973  893.3750  835.9871
#>  7:  61.0  62.00  62.0  63.00  65.0  67.00 1.0036034  926.5402  861.1900
#>  8: 182.0 183.00 185.0 186.00 188.0 191.00 0.9989872 1097.4089  937.1445
#>  9: 251.0 253.00 255.0 258.00 261.0 266.00 0.9991648 1111.3917 1021.2936
#> 10: 260.0 263.00 266.0 269.00 272.0 279.05 1.0073591 1059.0036  983.0723
#> 11: 228.0 232.00 235.0 237.35 241.0 248.00 1.0012317  975.8115  927.8796
#> 12: 221.0 225.00 229.0 232.00 237.0 246.00 0.9999872 1084.7105  951.3275
#> 13: 155.0 159.00 163.0 166.00 171.0 178.00 0.9994459 1041.2300  974.4463
#> 14: 123.0 127.00 130.0 133.00 137.0 145.00 1.0012796  935.7652 1050.2310
#> 15: 289.0 294.00 299.0 304.00 310.2 322.00 1.0017171 1130.4067  958.2443
#> 16: 288.8 295.00 301.0 308.00 317.0 334.05 1.0055266  848.0051  763.8073
#> 17: 291.0 300.65 309.0 317.35 329.0 356.00 1.0105072 1083.0271 1028.2641
#> 18: 288.8 303.00 315.0 330.00 343.2 383.00 1.0047446 1063.6034  939.8372
#> 19: 288.8 308.00 327.5 347.00 375.0 436.00 1.0005068 1007.8998  874.2774
#> 20: 247.8 276.00 306.0 340.35 390.2 493.05 1.0003640 1366.8407  840.3280

# Nowcast posterior samples
summary(nowcast, type = "nowcast_samples")
#>        reference_date report_date .group max_confirm location age_group confirm
#>     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
#>     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    409
#> 19997:                 1     0             1      2        497   997    362
#> 19998:                 1     0             1      2        498   998    272
#> 19999:                 1     0             1      2        499   999    247
#> 20000:                 1     0             1      2        500  1000    189

# Nowcast model fit
summary(nowcast, type = "fit")
#>                    variable          mean        median         sd        mad
#>   1:                   lp__ -1362.7433500 -1362.4000000  6.7742130  6.5753310
#>   2: expr_lelatent_int[1,1]     4.1434508     4.1380450  0.1539449  0.1552134
#>   3:           expr_beta[1]     0.3257798     0.3108810  0.4838097  0.4978898
#>   4:           expr_beta[2]    -0.2857518    -0.2857245  0.4811320  0.4351924
#>   5:           expr_beta[3]    -0.6982430    -0.6893515  0.5035263  0.4989661
#>  ---                                                                         
#> 852:       pp_inf_obs[16,1]   303.1380000   301.0000000 17.3757553 17.0499000
#> 853:       pp_inf_obs[17,1]   311.1310000   309.0000000 24.5036378 23.7216000
#> 854:       pp_inf_obs[18,1]   318.5220000   315.0000000 34.9239918 34.0998000
#> 855:       pp_inf_obs[19,1]   334.2310000   327.5000000 53.9676212 51.1497000
#> 856:       pp_inf_obs[20,1]   322.4300000   306.0000000 93.8689218 80.8017000
#>                 q5           q20           q80           q95      rhat
#>   1: -1374.5120000 -1.367952e+03 -1357.3100000 -1.352125e+03 1.0201797
#>   2:     3.8906655  4.018240e+00     4.2758060  4.402856e+00 0.9997963
#>   3:    -0.4580074 -9.366416e-02     0.7622114  1.104135e+00 1.0099929
#>   4:    -1.1171430 -6.469084e-01     0.1029920  5.050463e-01 1.0006211
#>   5:    -1.5294965 -1.135836e+00    -0.2657970  8.892956e-02 1.0001976
#>  ---                                                                  
#> 852:   278.0000000  2.888000e+02   317.0000000  3.340500e+02 1.0055266
#> 853:   275.0000000  2.910000e+02   329.0000000  3.560000e+02 1.0105072
#> 854:   270.0000000  2.888000e+02   343.2000000  3.830000e+02 1.0047446
#> 855:   258.0000000  2.888000e+02   375.0000000  4.360000e+02 1.0005068
#> 856:   198.0000000  2.478000e+02   390.2000000  4.930500e+02 1.0003640
#>       ess_bulk  ess_tail
#>   1:  223.5349  482.9928
#>   2: 1194.9226  825.8359
#>   3: 1159.2004  822.9336
#>   4: 1284.8243  642.2432
#>   5: 1285.1949  745.8015
#>  ---                    
#> 852:  848.0051  763.8073
#> 853: 1083.0271 1028.2641
#> 854: 1063.6034  939.8372
#> 855: 1007.8998  874.2774
#> 856: 1366.8407  840.3280

# Posterior predictions
summary(nowcast, type = "posterior_prediction")
#>      reference_date report_date .group max_confirm location age_group confirm
#>   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
#>   1:         0.3559322     0          21    0.35593220  23.512   22.0  9.740572
#>   2:         0.5593220     1          12    0.20338983  11.574   11.0  5.158016
#>   3:         0.6101695     2           3    0.05084746   6.492    6.0  3.540405
#>   4:         0.6779661     3           4    0.06779661   4.672    4.0  2.726509
#>   5:         0.7288136     4           3    0.05084746   2.765    3.0  1.896674
#>  ---                                                                           
#> 626:         0.9298246     1          61    0.35672515  47.044   43.5 19.194491
#> 627:         1.0000000     2          12    0.07017544  15.098   14.0  6.970867
#> 628:         0.6160714     0          69    0.61607143 109.043  100.0 45.345136
#> 629:         1.0000000     1          43    0.38392857  27.749   26.0 12.245814
#> 630:         1.0000000     0          45    1.00000000  52.151   49.0 23.805565
#>          mad    q5  q20 q35   q50    q65 q80    q95      rhat  ess_bulk
#>   1:  8.8956 10.00 15.0  19  22.0  26.00  31  42.00 0.9987800 1164.0127
#>   2:  4.4478  4.00  7.0   9  11.0  13.00  16  21.00 0.9988065 1016.1220
#>   3:  2.9652  1.00  3.0   5   6.0   7.00   9  13.00 1.0010941  942.2827
#>   4:  2.9652  1.00  2.0   3   4.0   5.00   7  10.00 1.0017034  817.9688
#>   5:  1.4826  0.00  1.0   2   3.0   3.00   4   6.00 1.0007183  982.1315
#>  ---                                                                   
#> 626: 17.0499 21.00 31.8  38  43.5  51.00  62  84.05 1.0056592  975.5135
#> 627:  5.9304  6.00  9.0  12  14.0  17.00  20  28.00 0.9986250  910.5990
#> 628: 38.5476 49.95 74.0  87 100.0 116.00 142 192.00 1.0011913  989.3871
#> 629: 11.8608 11.00 17.0  22  26.0  31.00  37  52.00 1.0000296  916.6473
#> 630: 22.2390 21.00 32.0  40  49.0  57.35  71  97.00 0.9997764 1035.8098
#>       ess_tail
#>   1:  834.6738
#>   2: 1032.3776
#>   3:  975.7223
#>   4:  782.9234
#>   5:  914.5297
#>  ---          
#> 626:  913.8415
#> 627: 1033.0860
#> 628:  933.3896
#> 629:  922.1847
#> 630:  904.4781