Skip to contents

Analytical solution for the exponential distribution, which is the gamma solution with shape = 1 without the incomplete gamma function. See vignette("analytic-solutions") for the derivation.

Usage

# S3 method for class 'pcens_pexp_dunif'
pcens_cdf(object, q, pwindow, use_numeric = FALSE)

Arguments

object

A primarycensored object as created by new_pcens().

q

Vector of quantiles

pwindow

Primary event window. Use pwindow = 0 for an exactly observed primary event, in which case the delay CDF is used directly.

use_numeric

Logical, if TRUE forces use of numeric integration even for distributions with analytical solutions. This is primarily useful for testing purposes or for settings where the analytical solution breaks down.

Value

Vector of computed primary event censored CDFs

Examples

pcens_obj <- new_pcens(
  pdist = pexp,
  dprimary = dunif,
  primary_args = list(min = 0, max = 1),
  rate = 0.5
)
pcens_cdf(pcens_obj, q = c(1, 4, 8), pwindow = 1)
#> [1] 0.2130613 0.8244102 0.9762365