+source("WP_known.R")
+source("WP_unknown.R")
+
#' WP method
#'
#' This function implements an R0 estimation due to White and Pagano (Statistics in Medicine, 2008).
#' res3 <- WP(NT=NT)
#' res3$Rhat
#' ## find mean of estimated serial distribution
-#' serial <- res3$SD
-#' sum(serial$supp*serial$pmf)
+#' serial <- res3$SD
+#' sum(serial$supp * serial$pmf)
#'
#' ## ========================================================= ##
#' ## Compute Rhat using only the first five weeks of data ##
#' ## ========================================================= ##
#'
-#' res4 <- WP(NT=NT[1:5], mu=5/7, method="known") # serial distribution has mean of five days
+#' res4 <- WP(NT=NT[1:5], mu=5/7, method="known") # serial distribution has mean of five days
#' res4$Rhat
#'
#' @export
p <- diff(pexp(0:range.max, 1/mu))
p <- p / sum(p)
res <- WP_known(NT=NT, p=p)
- Rhat <- res$Rhat
+ Rhat <- res
JJ <- NA
}
}
- 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)))
+ return(list(Rhat=Rhat, check=length(JJ), SD=list(supp=1:range.max, pmf=p)))
}