aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorNaeem Model <me@nmode.ca>2024-02-12 00:05:56 +0000
committerNaeem Model <me@nmode.ca>2024-02-12 00:05:56 +0000
commiteeaabbdfcedc832c78b253d92b95e48e61498716 (patch)
treedfa421e34df46e239cd5675ea4c9bd5aea7c04f4 /R
parente5e312d01bccbabbb21e69d269ccf0d947e5abdb (diff)
Update seqB documentation
Diffstat (limited to 'R')
-rw-r--r--R/seq_bayes.R8
1 files changed, 6 insertions, 2 deletions
diff --git a/R/seq_bayes.R b/R/seq_bayes.R
index 2f87121..59b7b4b 100644
--- a/R/seq_bayes.R
+++ b/R/seq_bayes.R
@@ -45,7 +45,7 @@
#' @return If `post` is identical to `TRUE`, a list containing the following
#' components is returned:
#' * `supp` - the support of the posterior distribution of R0
-#' * `pmf` - the probability mass function of the posterior distribution
+#' * `pmf` - the probability mass function of the posterior distribution of R0
#'
#' Otherwise, if `post` is identical to `FALSE`, only the estimate of R0 is
#' returned. Note that the estimate is equal to `sum(supp * pmf)` (i.e., the
@@ -74,10 +74,14 @@
#' # believed to be at most 4.
#' estimate <- seq_bayes(cases, mu = 1, kappa = 4)
#'
-#' # Same as above, but return the posterior distribution instead of the
+#' # Same as above, but return the posterior distribution of R0 instead of the
#' # estimate.
#' posterior <- seq_bayes(cases, mu = 1, kappa = 4, post = TRUE)
#'
+#' # Display the support and probability mass function of the posterior.
+#' posterior$supp
+#' posterior$pmf
+#'
#' # Note that the following always holds:
#' estimate == sum(posterior$supp * posterior$pmf)
seq_bayes <- function(cases, mu, kappa = 20, post = FALSE) {