R/ascertainment.R

Defines functions ascertainment

Documented in ascertainment

#' Estimate case ascertainment ratio
#'
#' @param cfr_distr 
#' @param death_to_case 
#'
#' @return
#' @export
#'
#' @examples
ascertainment <- function(cfr_distr, death_to_case) {
  rho <- array(NA, dim = dim(death_to_case))

  for (idx in seq_len(nrow(death_to_case))) {
    rho[idx, ] <- cfr_distr / death_to_case[idx, ]
    rho[idx, which(rho[idx, ] > 1)] <- 1
  }

  rho
}
sangeetabhatia03/ascertainr documentation built on April 30, 2020, 10:14 a.m.