Learn R Programming

primarycensored (version 1.3.0)

pcens_cdf.default: Default method for computing primary event censored CDF

Description

This method serves as a fallback for combinations of delay and primary event distributions that don't have specific implementations. It uses a numeric integration method.

Usage

# S3 method for default
pcens_cdf(object, q, pwindow, use_numeric = FALSE)

Value

Vector of computed primary event censored CDFs

Arguments

object

A primarycensored object as created by new_pcens().

q

Vector of quantiles

pwindow

Primary event window

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.

Details

This method implements the numerical integration approach for computing the primary event censored CDF. It uses the same mathematical formulation as described in the details section of pprimarycensored(), but applies numerical integration instead of analytical solutions.

See Also

pprimarycensored() for the mathematical details of the primary event censored CDF computation.

Low level primary event censored distribution objects and methods new_pcens(), pcens_cdf(), pcens_cdf.pcens_pgamma_dunif(), pcens_cdf.pcens_plnorm_dunif(), pcens_cdf.pcens_pweibull_dunif(), pcens_quantile(), pcens_quantile.default()

Examples

Run this code
# Create a primarycensored object with gamma delay and uniform primary
pcens_obj <- new_pcens(
  pdist = pgamma,
  dprimary = dunif,
  dprimary_args = list(min = 0, max = 1),
  shape = 3,
  scale = 2
)

# Compute CDF for a single value
pcens_cdf(pcens_obj, q = 9, pwindow = 1)

# Compute CDF for multiple values
pcens_cdf(pcens_obj, q = c(4, 6, 8), pwindow = 1)

Run the code above in your browser using DataLab