DelayedExponential | R Documentation |
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
).
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,
...
)
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
)
mexp_delayed(
t = +Inf,
delay1 = 0,
rate1 = 1,
delay2 = NULL,
rate2 = NULL,
delay = delay1,
rate = rate1
)
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. |
... |
further arguments are passed on to the underlying non-delayed function, e.g., |
p |
A numeric vector of probabilities. |
lower.tail |
logical. Give cumulative probability of lower tail? |
log.p |
logical. P-value on log-sclae? |
n |
integer. Number of random observations requested. |
t |
A numeric vector of times that restrict the mean survival. Default is |
Additional arguments are forwarded via ...
to the underlying functions of the exponential distribution in the stats
-package.
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.
Functions pertaining to the delayed exponential distribution:
dexp_delayed
gives the density
pexp_delayed
gives the distribution function
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.
stats::Exponential
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.