Skip to contents

Analytical solution for the inverse gamma distribution of extraDistr::pinvgamma(), with shape alpha and scale beta. The extraDistr package is needed to create the pcens object. The solution needs a finite mean, so shapes at or below 1 use the numerical pcens_cdf.default() method. See vignette("analytic-solutions") for the derivation.

Usage

# S3 method for class 'pcens_pinvgamma_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 = extraDistr::pinvgamma,
  dprimary = dunif,
  primary_args = list(min = 0, max = 1),
  alpha = 3,
  beta = 2
)
pcens_cdf(pcens_obj, q = c(1, 4, 8), pwindow = 1)
#> [1] 0.2706706 0.9789848 0.9973887