DelayedExponential: Delayed Exponential Distribution

DelayedExponentialR Documentation

Delayed Exponential Distribution

Description

Density, distribution function, quantile function, random generation and restricted mean survival time function for the delayed exponential distribution. There is an initial delay phase (parameter delay1) where no events occur. After that, rate1 applies. Optionally, a second phase is possible where the hazard rate might change (parameters delay2 and rate2).

Usage

dexp_delayed(
  x,
  delay1 = 0,
  rate1 = 1,
  delay2 = NULL,
  rate2 = NULL,
  delay = delay1,
  rate = rate1,
  log = FALSE
)

pexp_delayed(
  q,
  delay1 = 0,
  rate1 = 1,
  delay2 = NULL,
  rate2 = NULL,
  delay = delay1,
  rate = rate1,
  lower.tail = TRUE,
  log.p = FALSE,
  grad = FALSE
)

qexp_delayed(
  p,
  delay1 = 0,
  rate1 = 1,
  delay2 = NULL,
  rate2 = NULL,
  delay = delay1,
  rate = rate1,
  lower.tail = TRUE,
  log.p = FALSE
)

rexp_delayed(
  n,
  delay1 = 0,
  rate1 = 1,
  delay2 = NULL,
  rate2 = NULL,
  delay = delay1,
  rate = rate1,
  cens = 0
)

mexp_delayed(
  t = +Inf,
  delay1 = 0,
  rate1 = 1,
  delay2 = NULL,
  rate2 = NULL,
  delay = delay1,
  rate = rate1
)

Arguments

x

A numeric vector of values for which to get the density.

delay1

numeric. The first delay, must be non-negative.

rate1

numeric. The event rate, must be non-negative.

delay2

numeric. The second delay, must be non-negative.

rate2

numeric. The second event rate, must be non-negative.

delay

numeric. Alias for first delay.

rate

numeric. Alias for first rate.

log

logical. Return value on log-scale?

q

A numeric vector of quantile values.

lower.tail

logical. Give cumulative probability of lower tail?

log.p

logical. P-value on log-scale?

grad

logical. Should the gradient be calculated at the given quantile values (and not the cumulative probabilities)?

p

A numeric vector of probabilities.

n

integer. Number of random observations requested.

cens

numeric. In [0, 1). Expected proportion of random right-censored observations.

t

A numeric vector of times that restrict the mean survival. Default is +Inf, i.e., the unrestricted mean survival time.

Details

If only a single initial delay phase is there, the numerical arguments other than n are recycled to the length of the result (as with the exponential distribution in stats). With two phases, the arguments are not recycled. Only the first element of delays and rates are used as it otherwise becomes ambiguous which delay and rate parameter apply for observations in different phases. Generally, only the first elements of the logical arguments are used.

When ⁠cens=⁠ is specified greater than 0, the actual number of censored observations is random. On average, it equals the expected number of censored observations as given by cens.

Value

Functions pertaining to the delayed exponential distribution:

  • dexp_delayed gives the density

  • pexp_delayed gives the vector of cumulative probabilities or the gradient matrix (nbr parameters x quantile times)

  • qexp_delayed gives the quantile function

  • rexp_delayed generates a pseudo-random sample

  • mexp_delayed gives the restricted mean survival time

The length of the result is determined by n for rexp_delayed, and is the maximum of the lengths of the numerical arguments for the other functions, R's recycling rules apply when only single initial delay phase is used.

Vector of cumulative probabilities or gradient matrix (nbr parameter x quantile times)

See Also

stats::Exponential


incubate documentation built on Nov. 22, 2026, 1:07 a.m.