Skip to contents

The inverse chi-square distribution of extraDistr::pinvchisq() with nu degrees of freedom is the inverse gamma distribution with alpha = nu / 2 and beta = 1 / 2. With a scale tau it is the scaled inverse chi-square distribution, with beta = nu * tau / 2. Both use pcens_cdf.pcens_pinvgamma_dunif(), so nu at or below 2 uses the numerical pcens_cdf.default() method.

Usage

# S3 method for class 'pcens_pinvchisq_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::pinvchisq,
  dprimary = dunif,
  primary_args = list(min = 0, max = 1),
  nu = 5
)
pcens_cdf(pcens_obj, q = c(0.5, 1, 4), pwindow = 1)
#> [1] 0.2337703 0.6954818 0.9978444