
Method for generalised gamma delay with uniform primary
Source:R/pcens_cdf.R
pcens_cdf.pcens_pgengamma.orig_dunif.RdAnalytical solution for the generalised gamma distribution in the Stacy
parameterisation used by flexsurv::pgengamma.orig(), with parameters
shape, scale and k.
The delay CDF is \(F_T(t) = P(k, (t / \theta)^a)\) with \(P\) the
regularised lower incomplete gamma function, \(a\) the shape and
\(\theta\) the scale.
The mean is \(E[T] = \theta \Gamma(k + 1/a) / \Gamma(k)\) and the partial
expectation distribution is \(\tilde F_T(t) = P(k + 1/a, (t / \theta)^a)\),
so the solution generalises the gamma (shape = 1) and Weibull (k = 1)
cases.
See vignette("analytic-solutions") for the derivation.
Usage
# S3 method for class 'pcens_pgengamma.orig_dunif'
pcens_cdf(object, q, pwindow, use_numeric = FALSE)Arguments
- object
A
primarycensoredobject as created bynew_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.
See also
Low level primary event censored distribution objects and methods
new_pcens(),
pcens_cdf(),
pcens_cdf.default(),
pcens_cdf.pcens_pdiscretehazard(),
pcens_cdf.pcens_pdiscretestep(),
pcens_cdf.pcens_pgamma_dunif(),
pcens_cdf.pcens_pgengamma_dunif(),
pcens_cdf.pcens_plnorm_dunif(),
pcens_cdf.pcens_pweibull_dunif(),
pcens_quantile(),
pcens_quantile.default()
Examples
pcens_obj <- new_pcens(
pdist = flexsurv::pgengamma.orig,
dprimary = dunif,
dprimary_args = list(min = 0, max = 1),
shape = 1.5,
scale = 2,
k = 0.8
)
#> Warning: The `dprimary_args` argument of `new_pcens()` is deprecated as of
#> primarycensored 1.6.0.
#> ℹ Please use the `primary_args` argument instead.
pcens_cdf(pcens_obj, q = c(1, 4, 8), pwindow = 1)
#> [1] 0.1940835 0.9298869 0.9995685