Skip to contents

Computes the analytic primary event censored CDF for a piecewise-constant (step) delay distribution and an arbitrary primary event distribution whose CDF \(F_{primary}\) is available via object$pprimary.

Usage

# S3 method for class 'pcens_pdiscretestep'
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_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

Details

The observation CDF is $$F_{obs}(q) = \int_0^{pwindow} F_{step}(q-p)\,dF_{primary}(p)$$ Because \(F_{step}\) is piecewise constant, the integral reduces to $$F_{obs}(q) = \sum_k c_k \,[F_{primary}(p^{end}_k) - F_{primary}(p^{start}_k)]$$ where \(c_k\) is the constant value of \(F_{step}\) on the \(k\)-th sub-interval of the primary event window induced by the step-function knots. The partition is exact for any bin widths, so bins may be wider or narrower than pwindow, and for boundaries that start below zero.

Falls back to pcens_cdf.default when use_numeric = TRUE or when no primary CDF is available on the object.