-#' value \code{mu} is that of a continuous distribution. The algorithm
-#' discretizes this input when \code{mu} is not \code{NA}, and hence the mean of
-#' the serial distribution returned in the list \code{SD} will differ from
-#' \code{mu} somewhat. That is to say, if the user notices that the input
-#' \code{mu} and output mean of \code{SD} are different, this is to be expected,
-#' and is caused by the discretization.
-#'
-#' @param NT Vector of case counts.
-#' @param mu Mean of the serial distribution (needs to match case counts in time
-#' units; for example, if case counts are weekly and the serial
-#' distribution has a mean of seven days, then \code{mu} should be set
-#' to one). The default value of \code{mu} is set to \code{NA}.
-#' @param search List of default values for the grid search algorithm. The list
-#' includes three elements: the first is \code{B}, which is the
-#' length of the grid in one dimension; the second is
-#' \code{scale.max}, which is the largest possible value of the
-#' scale parameter; and the third is \code{shape.max}, which is
-#' the largest possible value of the shape parameter. Defaults to
-#' \code{B = 100, scale.max = 10, shape.max = 10}. For both shape
-#' and scale, the smallest possible value is 1/\code{B}.
-#' @param tol Cutoff value for cumulative distribution function of the
-#' pre-discretization gamma serial distribution. Defaults to 0.999
-#' (i.e. in the discretization, the maximum is chosen such that the
-#' original gamma distribution has cumulative probability of no more
-#' than 0.999 at this maximum).
-#'
-#' @return \code{WP} returns a list containing the following components:
-#' \code{Rhat} is the estimate of R0, and \code{SD} is either the
-#' discretized serial distribution (if \code{mu} is not \code{NA}), or
-#' the estimated discretized serial distribution (if \code{mu} is
-#' \code{NA}). The list also returns the variable \code{check}, which is
-#' equal to the number of non-unique maximum likelihood estimators. The
-#' serial distribution \code{SD} is returned as a list made up of
-#' \code{supp} (the support of the distribution) and \code{pmf} (the
-#' probability mass function).
+#' value `mu` is that of a continuous distribution. The algorithm discretizes
+#' this input, and so the mean of the estimated serial distribution returned
+#' (when `serial` is set to `TRUE`) will differ from `mu` somewhat. That is to
+#' say, if the user notices that the input `mu` and the mean of the estimated
+#' serial distribution are different, this is to be expected, and is caused by
+#' the discretization.
+#'
+#' @param cases Vector of case counts. The vector must be of length at least two
+#' and only contain positive integers.
+#' @param mu Mean of the serial distribution. This must be a positive number or
+#' `NA`. If a number is specified, the value should match the case counts in
+#' time units. For example, if case counts are weekly and the serial
+#' distribution has a mean of seven days, then `mu` should be set to `1`. If
+#' case counts are daily and the serial distribution has a mean of seven days,
+#' then `mu` should be set to `7`.
+#' @param serial Whether to return the estimated serial distribution in addition
+#' to the estimate of R0. This must be a value identical to `TRUE` or `FALSE`.
+#' @param grid_length The length of the grid in the grid search (defaults to
+#' 100). This must be a positive integer. It will only be used if `mu` is set
+#' to `NA`. The grid search will go through all combinations of the shape and
+#' scale parameters for the gamma distribution, which are `grid_length` evenly
+#' spaced values from `0` (exclusive) to `max_shape` and `max_scale`
+#' (inclusive), respectively. Note that larger values will result in a longer
+#' search time.
+#' @param max_shape The largest possible value of the shape parameter in the
+#' grid search (defaults to 10). This must be a positive number. It will only
+#' be used if `mu` is set to `NA`. Note that larger values will result in a
+#' longer search time, and may cause numerical instabilities.
+#' @param max_scale The largest possible value of the scale parameter in the
+#' grid search (defaults to 10). This must be a positive number. It will only
+#' be used if `mu` is set to `NA`. Note that larger values will result in a
+#' longer search time, and may cause numerical instabilities.
+#'
+#' @return If `serial` is identical to `TRUE`, a list containing the following
+#' components is returned:
+#' * `r0` - the estimate of R0
+#' * `supp` - the support of the estimated serial distribution
+#' * `pmf` - the probability mass function of the estimated serial
+#' distribution
+#'
+#' Otherwise, if `serial` is identical to `FALSE`, only the estimate of R0 is
+#' returned.
+#'
+#' @references
+#' [White and Pagano (Statistics in Medicine, 2008)](
+#' https://doi.org/10.1002/sim.3136)
+#'
+#' @seealso `vignette("wp_serial", package="Rnaught")` for examples of using the
+#' serial distribution.
+#'
+#' @importFrom stats pgamma qgamma
+#'
+#' @export