eha (version 2.8.5)

Pch: 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 \(P(X \le x)\), otherwise, \(P(X > x)\).

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 length(n) > 1, the length is taken to be the number required.

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.

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.