A generic wrapper around posterior::summarise_draws()
with
opinionated defaults.
Usage
enw_posterior(fit, variables = NULL, probs = c(0.05, 0.2, 0.8, 0.95), ...)
Arguments
- fit
A
cmdstanr
fit object.- variables
A character vector of variables to return posterior summaries for. By default summaries for all parameters are returned.
- probs
A vector of numeric probabilities to produce quantile summaries for. By default these are the 5%, 20%, 80%, and 95% quantiles which are also the minimum set required for plotting functions to work.
- ...
Additional arguments that may be passed but will not be used.
See also
Functions used for postprocessing of model fits
build_ord_obs()
,
enw_add_latest_obs_to_nowcast()
,
enw_nowcast_samples()
,
enw_nowcast_summary()
,
enw_pp_summary()
,
enw_quantiles_to_long()
,
enw_summarise_samples()
,
subset_obs()
Examples
fit <- enw_example("nowcast")
enw_posterior(fit$fit[[1]], variables = "expr_beta")
#> variable mean median sd mad q5
#> <char> <num> <num> <num> <num> <num>
#> 1: expr_beta[1] 0.28462485 0.29509500 0.5786645 0.5786297 -0.6218335
#> 2: expr_beta[2] -0.29824007 -0.30584250 0.5611535 0.5248785 -1.2319820
#> 3: expr_beta[3] -0.80325415 -0.78606900 0.5592632 0.5652835 -1.7333510
#> 4: expr_beta[4] 0.44809555 0.45732650 0.5616229 0.5459552 -0.4728573
#> 5: expr_beta[5] -0.44412108 -0.45713800 0.5151270 0.5017155 -1.2717015
#> 6: expr_beta[6] -0.25438165 -0.26337750 0.5554739 0.5113289 -1.1240380
#> 7: expr_beta[7] 1.71051958 1.72067000 0.5528633 0.5232318 0.8098673
#> 8: expr_beta[8] 0.33786860 0.31259100 0.5293036 0.5297987 -0.4776585
#> 9: expr_beta[9] 0.23446467 0.22539550 0.5212860 0.5045340 -0.6429576
#> 10: expr_beta[10] -0.36462422 -0.37648600 0.5160271 0.5015791 -1.2176160
#> 11: expr_beta[11] -0.14859906 -0.14181650 0.5138760 0.4920772 -0.9736318
#> 12: expr_beta[12] -0.57792006 -0.53897750 0.5145084 0.5146364 -1.4595760
#> 13: expr_beta[13] -1.21917671 -1.22239000 0.5563030 0.5111234 -2.1660930
#> 14: expr_beta[14] 1.54514021 1.55213500 0.5675533 0.5810309 0.6416047
#> 15: expr_beta[15] 1.76318288 1.76420500 0.5427156 0.5421646 0.8446333
#> 16: expr_beta[16] -0.20550827 -0.21182600 0.4779995 0.4717811 -0.9567022
#> 17: expr_beta[17] -0.23174271 -0.24414800 0.4694997 0.4539537 -0.9858930
#> 18: expr_beta[18] -0.18754505 -0.18813200 0.4676043 0.4385123 -0.9697473
#> 19: expr_beta[19] -0.55261198 -0.53412950 0.4703680 0.4366287 -1.3653600
#> 20: expr_beta[20] -0.34030283 -0.34179000 0.5020776 0.4885501 -1.1599075
#> 21: expr_beta[21] 1.62665535 1.60997500 0.5207666 0.4905775 0.7949809
#> 22: expr_beta[22] 0.42756972 0.42526100 0.4784881 0.4709598 -0.3434324
#> 23: expr_beta[23] -0.25828835 -0.25516650 0.4703554 0.4953085 -1.0259825
#> 24: expr_beta[24] -0.37230974 -0.36565000 0.4753320 0.4750072 -1.1500190
#> 25: expr_beta[25] -0.07612101 -0.08053165 0.4582035 0.4474568 -0.8523371
#> 26: expr_beta[26] -0.88130163 -0.87247950 0.4833402 0.4674178 -1.6579380
#> 27: expr_beta[27] -0.65837345 -0.68648300 0.5394958 0.5189374 -1.5591630
#> 28: expr_beta[28] 2.08622226 2.08300000 0.5563279 0.5491476 1.1987955
#> 29: expr_beta[29] 1.58810432 1.56012000 0.5093989 0.5226165 0.8192915
#> 30: expr_beta[30] 0.12127866 0.09202365 0.4851543 0.4777760 -0.6538401
#> 31: expr_beta[31] -0.64421710 -0.66400650 0.4889007 0.5201517 -1.4733895
#> 32: expr_beta[32] -0.25341394 -0.26969650 0.4939534 0.4792949 -1.0800925
#> 33: expr_beta[33] -0.63780395 -0.65134800 0.5066924 0.4976710 -1.4558045
#> 34: expr_beta[34] -0.14354635 -0.17152200 0.5423078 0.5453663 -1.0139625
#> 35: expr_beta[35] 1.46389603 1.47108000 0.5118771 0.5021566 0.6364592
#> 36: expr_beta[36] 0.16942632 0.15285250 0.5369581 0.5285914 -0.7309440
#> 37: expr_beta[37] 0.05247919 0.06230440 0.5687812 0.5497131 -0.9442288
#> 38: expr_beta[38] 0.10600585 0.08257225 0.6157405 0.6381570 -0.9075812
#> 39: expr_beta[39] 0.14453159 0.11814650 0.6503159 0.6026258 -0.9356451
#> 40: expr_beta[40] 0.41646368 0.42157900 0.7205522 0.7279492 -0.7860046
#> variable mean median sd mad q5
#> q20 q80 q95 rhat ess_bulk ess_tail
#> <num> <num> <num> <num> <num> <num>
#> 1: -0.232657200 0.75022200 1.2488665 1.0012756 1404.7190 856.3218
#> 2: -0.732569000 0.15508160 0.6342570 1.0002675 1539.8589 702.7720
#> 3: -1.283000000 -0.33545220 0.0798450 1.0039448 1380.2039 862.2779
#> 4: -0.004142558 0.92600500 1.3215800 0.9996323 1203.3461 664.4341
#> 5: -0.878409200 -0.02079704 0.3932522 1.0007057 1147.2801 866.5113
#> 6: -0.697305800 0.18103120 0.6810595 1.0097456 1156.3047 702.9367
#> 7: 1.267796000 2.15495600 2.5721150 0.9997513 1166.1734 774.4591
#> 8: -0.118038600 0.78672960 1.2221485 1.0016189 1134.8078 611.3088
#> 9: -0.191021200 0.68418780 1.0933440 1.0036997 1122.2276 486.6781
#> 10: -0.786309800 0.06987092 0.4975437 1.0004769 1223.6144 660.7525
#> 11: -0.554858200 0.26752960 0.6757380 1.0009107 1401.3103 856.0276
#> 12: -0.998188200 -0.14080160 0.2292662 1.0017892 1041.4966 642.6171
#> 13: -1.663180000 -0.78886320 -0.3142611 1.0000317 1154.3115 762.4363
#> 14: 1.071688000 2.02048000 2.4865400 0.9994620 1201.8206 609.7754
#> 15: 1.295538000 2.21468400 2.6773295 1.0010593 1159.1155 748.9531
#> 16: -0.603703600 0.18094020 0.6079322 1.0018655 1045.7084 558.2510
#> 17: -0.606814000 0.16682200 0.5377316 0.9996488 788.5439 572.9795
#> 18: -0.549881600 0.20386720 0.6024509 1.0002303 959.8177 723.9376
#> 19: -0.937218800 -0.19098520 0.1923644 1.0021605 1095.4859 852.9632
#> 20: -0.757948000 0.08590670 0.4254228 1.0064461 1055.1931 767.7107
#> 21: 1.202814000 2.04965400 2.4963815 1.0008698 1274.2689 875.5343
#> 22: 0.021378180 0.83263040 1.2398070 1.0038887 1037.8236 528.4962
#> 23: -0.687777000 0.15987640 0.4971194 0.9988418 930.6136 711.0018
#> 24: -0.767840200 0.03301844 0.3807726 0.9985956 1256.5805 665.5190
#> 25: -0.449886400 0.29412460 0.6770386 1.0058506 1320.8727 699.9874
#> 26: -1.291930000 -0.48327440 -0.1267343 1.0017966 1142.9828 890.5797
#> 27: -1.094310000 -0.19014860 0.2589386 1.0053194 1083.8850 674.6074
#> 28: 1.596204000 2.56402600 3.0015680 1.0031514 1283.7817 761.2919
#> 29: 1.138386000 1.99792800 2.4255930 0.9993590 978.3030 613.5307
#> 30: -0.261180400 0.54152560 0.9449894 1.0007208 1279.8328 773.7010
#> 31: -1.053202000 -0.20406940 0.1317774 1.0029927 1096.3248 839.4981
#> 32: -0.637252400 0.14103840 0.5597247 1.0006874 973.8768 770.2526
#> 33: -1.063976000 -0.20403380 0.2055194 1.0020892 1070.3594 734.7207
#> 34: -0.589239200 0.32723760 0.6809532 0.9992134 958.7317 795.5780
#> 35: 1.029168000 1.88105800 2.3151455 1.0005968 1125.2178 817.4606
#> 36: -0.272429800 0.61971980 1.0541715 0.9995794 1201.7405 770.6869
#> 37: -0.424746200 0.51775000 0.9824709 1.0014445 1258.3386 875.1625
#> 38: -0.426933200 0.65077880 1.1149245 0.9996211 1459.9911 821.9748
#> 39: -0.378937800 0.70247240 1.2278895 1.0025875 1667.8788 756.4348
#> 40: -0.196842200 1.02761800 1.6101840 1.0007384 1820.6056 818.3647
#> q20 q80 q95 rhat ess_bulk ess_tail