]> nmode's Git Repositories - Rnaught/blobdiff - R/seq_bayes.R
Update seqB documentation
[Rnaught] / R / seq_bayes.R
index 107d428276229e7d8a3ebc27af18d1e586717419..59b7b4b0a107f1bec314ea3fa63b69cbc235632a 100644 (file)
@@ -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
@@ -55,6 +55,9 @@
 #' [Bettencourt and Riberio (PloS One, 2008)](
 #' https://doi.org/10.1371/journal.pone.0002185)
 #'
+#' @seealso `vignette("seq_bayes_post", package = "Rnaught")` for examples of
+#'   using the posterior distribution.
+#'
 #' @export
 #'
 #' @examples
 #' # 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) {