Density, distribution function, quantile function, and random generation for the power piecewise Weibull distribution.
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)
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.
Vector of quantiles for the density function.
Vector of quantiles for the distribution function.
Vector of probabilities for the quantile function.
Number of observations to generate. If length(n) > 1, the length
is taken as the number of observations.
A numeric vector of length \(L\) containing the rate parameters \(\lambda_1, \ldots, \lambda_L\).
A numeric vector of length \(L\) containing the shape parameters \(\alpha_1, \ldots, \alpha_L\).
A non-decreasing vector defining the time partition \((0 = a_0, a_1, \ldots, a_L)\).
Logical; if TRUE, probabilities are returned on the log scale.
Logical; if TRUE (default), probabilities are
\(P(T \le q)\); otherwise \(P(T > q)\).
Logical; if TRUE, probabilities p are given on the log scale.
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.
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.
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