Pch {eha} | R Documentation |
The Piecewise Constant Hazards distribution.
Description
Density, distribution function, quantile function, hazard function, cumulative hazard function, mean, and random generation for the Piecewice Constant Hazards (pch) distribution.
Usage
ppch(q, cuts, levels, lower.tail = TRUE, log.p = FALSE)
dpch(x, cuts, levels, log = FALSE)
hpch(x, cuts, levels, log = FALSE)
Hpch(x, cuts, levels, log.p = FALSE)
qpch(p, cuts, levels, lower.tail = TRUE, log.p = FALSE)
mpch(cuts, levels)
rpch(n, cuts, levels)
Arguments
cuts |
Vector of cut points defining the intervals where the hazard function is constant. |
levels |
Vector of levels (values of the hazard function). |
lower.tail |
logical; if TRUE (default), probabilities are
|
x , q |
vector of quantiles. |
p |
vector of probabilities. |
log , log.p |
logical; if TRUE, probabilities p are given as log(p). |
n |
number of observations. If |
Details
The pch distribution has a hazard function that is piecewise constant on intervals defined by cutpoints
0 < c_1 < \cdots < c_n < \infty, n \ge 0
If n = 0
, this reduces to an exponential distribution.
Value
dpch
gives the density,
ppch
gives the distribution function,
qpch
gives the quantile function,
hpch
gives the hazard function,
Hpch
gives the cumulative hazard function,
mpch
gives the mean, and
rpch
generates random deviates.
Note
the parameter levels
must have length at least 1, and the
number of cut points must be one less than the number of levels.