.dpcens {primarycensored}R Documentation

Define a fitdistrplus compatible wrapper around dprimarycensored

Description

Define a fitdistrplus compatible wrapper around dprimarycensored

Usage

.dpcens(
  x,
  swindows,
  pdist,
  pwindow,
  D,
  dprimary,
  dprimary_args,
  pdist_name,
  dprimary_name,
  ...
)

Arguments

x

Vector of quantiles

swindows

A numeric vector of secondary window sizes corresponding to each element in x

pdist

Distribution function (CDF)

pwindow

Primary event window

D

Maximum delay (truncation point). If finite, the distribution is truncated at D. If set to Inf, no truncation is applied. Defaults to Inf.

dprimary

Function to generate the probability density function (PDF) of primary event times. This function should take a value x and a pwindow parameter, and return a probability density. It should be normalized to integrate to 1 over [0, pwindow]. Defaults to a uniform distribution over [0, pwindow]. Users can provide custom functions or use helper functions like dexpgrowth for an exponential growth distribution. See primary_dists.R for examples.

dprimary_args

List of additional arguments to be passed to dprimary. For example, when using dexpgrowth, you would pass list(min = 0, max = pwindow, r = 0.2) to set the minimum, maximum, and rate parameters

pdist_name

A string specifying the name of the delay distribution function. If NULL, the function name is extracted using .extract_function_name(). Used to determine if a analytical solution exists for the primary censored distribution. Must be set if pdist is passed a pre-assigned variable rather than a function name.

dprimary_name

A string specifying the name of the primary event distribution function. If NULL, the function name is extracted using .extract_function_name(). Used to determine if a analytical solution exists for the primary censored distribution. Must be set if dprimary is passed a pre-assigned variable rather than a function name.

...

Additional arguments to be passed to the distribution function


[Package primarycensored version 1.0.0 Index]