The Piecewise constant hazards (Pch) distribution

Description

Density, distribution function, quantile function, hazard function, cumulative hazard function, and random generation for the pch distribution with parameters cuts and levels.

Usage

1
2
3
4
5
6
dpch(x, cuts, levels, log = FALSE)
ppch(q, cuts, levels, lower.tail = TRUE, log.p = FALSE)
qpch(p, cuts, levels, lower.tail = TRUE, log.p = FALSE)
hpch(x, cuts, levels, log = FALSE)
Hpch(x, cuts, levels, log.p = FALSE)
rpch(n, cuts, levels)

Arguments

x, q

vector of quantiles.

p

vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

cuts, levels

cuts devine the intervals where the hazard function is constant. The cuts must be strictly positive and finite. levels are the interval-constant values, one more than the cuts.

log, log.p

logical; if TRUE, probabilities p are given as log(p).

lower.tail

logical; if TRUE (default), probabilities are P(X <= x), otherwise, P(X > x).

Details

The Pch distribution is defined by the cuts and the levels so that the hazard function is constant on intervals.

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, and rpch generates random deviates.

Invalid arguments will result in return value NaN, with a warning.

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.