Learn R Programming

ppweibull (version 1.0)

pweibull: The Power Piecewise Weibull Distribution

Description

Density, distribution function, quantile function, and random generation for the power piecewise Weibull distribution.

Usage

dpweibull(x, rate = 1, alpha = 1, t = 0, log = FALSE)

ppweibull(q, rate = 1, alpha = 1, t = 0, lower.tail = TRUE, log.p = FALSE)

qpweibull(p, rate = 1, alpha = 1, t = 0, lower.tail = TRUE, log.p = FALSE)

rpweibull(n = 1, rate = 1, alpha = 1, t = 0)

Value

dpweibull returns the density, ppweibull returns the distribution function, qpweibull returns the quantile function, and rpweibull generates random deviates.

For rpweibull, the result has length n. For the other functions, the result has length equal to the maximum of the lengths of the numerical arguments. Arguments are recycled as needed.

Only the first elements of the logical arguments log, lower.tail, and log.p are used.

Arguments

x

Vector of quantiles for the density function.

q

Vector of quantiles for the distribution function.

p

Vector of probabilities for the quantile function.

n

Number of observations to generate. If length(n) > 1, the length is taken as the number of observations.

rate

A numeric vector of length \(L\) containing the rate parameters \(\lambda_1, \ldots, \lambda_L\).

alpha

A numeric vector of length \(L\) containing the shape parameters \(\alpha_1, \ldots, \alpha_L\).

t

A non-decreasing vector defining the time partition \((0 = a_0, a_1, \ldots, a_L)\).

log

Logical; if TRUE, probabilities are returned on the log scale.

lower.tail

Logical; if TRUE (default), probabilities are \(P(T \le q)\); otherwise \(P(T > q)\).

log.p

Logical; if TRUE, probabilities p are given on the log scale.

Details

The hazard function of the power piecewise Weibull model is

$$ h(t \mid \boldsymbol{\lambda}, \boldsymbol{\alpha}) = \lambda_\ell \alpha_\ell t^{\alpha_\ell - 1}, \qquad t \in (a_{\ell - 1}, a_\ell),\; \ell = 1, \ldots, L, $$

where \(0 = a_0 < a_1 < \cdots < a_{L - 1} < a_L < \infty\) defines the partition of time, \(\boldsymbol{\lambda} = (\lambda_1, \ldots, \lambda_L)\), and \(\boldsymbol{\alpha} = (\alpha_1, \ldots, \alpha_L)\).

Special cases include:

  • \(\alpha_1 = \cdots = \alpha_L = 1\): the piecewise exponential model (Feigl and Zelen, 1965; Friedman, 1982),

  • \(\alpha_1 = \cdots = \alpha_L = 2\): a piecewise Rayleigh model.

References

Feigl P., Zelen M. (1965). Estimation of exponential survival probabilities with concomitant information. Biometrics, 21, 826-838.

Friedman M. (1982). Piecewise exponential models for survival data with covariates. Annals of Statistics, 10, 101-113.

Gomez Y. M., Gallardo D. I., Arnold B. C. (2018). The power piecewise exponential model. Journal of Statistical Computation and Simulation, 88, 825-840.

Examples

Run this code
set.seed(3100)
## Random sample
rpweibull(n = 10, rate = c(0.05, 0.03), alpha = c(1, 1.5), t = c(0, 10))
## Distribution function
ppweibull(c(5, 10, 20), rate = c(0.05, 0.03), alpha = c(1, 1.5), t = c(0, 10))

Run the code above in your browser using DataLab