aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorhannajankowski <hkj@yorku.ca>2022-07-28 11:25:47 -0400
committerGitHub <noreply@github.com>2022-07-28 11:25:47 -0400
commit520116092ceca1a831fdc716eb20e8356303dec0 (patch)
tree316b5f188e9cb2d00248c6f3c6b379900a634bc0 /R
parent6192feb2f834982b0f51f65e59da051d9eb71118 (diff)
Update WP.R
Diffstat (limited to 'R')
-rw-r--r--R/WP.R6
1 files changed, 3 insertions, 3 deletions
diff --git a/R/WP.R b/R/WP.R
index 3096bc4..f2eb536 100644
--- a/R/WP.R
+++ b/R/WP.R
@@ -2,9 +2,9 @@
#'
#' This function implements an R0 estimation due to White and Pagano (Statistics in Medicine, 2008). The method is based on maximum likelihood estimation in a Poisson transmission model. See details for important implementation notes.
#'
-#' The model developed in White and Pagano (2008) requires knowledge of the serial distribution. In their model, the serial distribution is assumed to be finite discrete. In this implementation, if the serial distribution is assumed known, it is taken to be a discretized version of a gamma distribution with mean \code{mu}, shape parameter one, and largest possible value based on parameter \code{tol}. When the serial distribution is unknown, the function implements a grid search algorithm to find the maximum likelihood estimator over all possible gamma distributions with unknown mean and variance, restricting these to a prespecified grid (see \code{search} parameter).
+#' This method is based on a Poisson transmission model, which may be most most valid at the beginning of an epidemic. It was developed in White and Pagano (2008). In their model, the serial distribution is assumed to be discrete with a finite number of posible values. In this implementation, if the serial distribution is assumed known, it is taken to be a discretized version of a gamma distribution with mean \code{mu}, shape parameter one, and largest possible value based on parameter \code{tol}. When the serial distribution is unknown, the function implements a grid search algorithm to find the maximum likelihood estimator over all possible gamma distributions with unknown mean and variance, restricting these to a prespecified grid (see \code{search} parameter).
#'
-#' This method is based on a Poisson transmission model, which may be most most valid at the beginning of an epidemic. When the serial distribution is taken to be \code{known}, sensitivity testing is recommended. If the serial distribution is \code{unknown}, the likelihood function can be flat near the maximum, resulting in numerical instability of the optimizer. Users should be careful about units of time (e.g. are counts observed daily or weekly?) when implementing.
+#' When the serial distribution is taken to be \code{known}, sensitivity testing of the parameter \code{mu} is strongly recommended. If the serial distribution is \code{unknown}, the likelihood function can be flat near the maximum, resulting in numerical instability of the optimizer. Users should be careful about units of time (e.g. are counts observed daily or weekly?) when implementing. When the serial distribution is \code{unkown} the implementation takes considerably longer to run.
#'
#' The model developed in White and Pagano (2008) is discrete, and hence the serial distribution is finite discrete. Due to this implementation (inspired by that suggested in White and Pagano (2008)), the input value \code{mu} is that of a continuous distribution. The algorithm when \code{method="known"} disretizes this input, and hence the mean of the serial distribution returned in the list \code{SD} will differ from \code{mu} somewhat.
#'
@@ -86,4 +86,4 @@ WP <- function(NT, mu="NA", method="unknown", search=list(B=100, shape.max=10, s
return(list(Rhat=Rhat, check=length(JJ), SD=list(supp=1:range.max, pmf=p), inputs=list(NT=NT, mu=mu, method=method, search=search, tol=tol)))
-} \ No newline at end of file
+}