View source: R/probability_tools.R
| dweibull3p | R Documentation |
Density, cumulative distribution function, quantile function, and random
generation for the three-parameter Weibull distribution with shape
\beta > 0, scale \alpha > 0, and threshold (location)
\gamma. The support is x > \gamma.
dweibull3p(x, shape, scale, thres, log = FALSE)
pweibull3p(q, shape, scale, thres, lower.tail = TRUE, log.p = FALSE)
qweibull3p(p, shape, scale, thres, lower.tail = TRUE, log.p = FALSE)
rweibull3p(n, shape, scale, thres)
x, q |
Numeric vector of quantiles. |
p |
Numeric vector of probabilities in |
n |
Integer: number of observations to generate. |
shape |
Positive shape parameter |
scale |
Positive scale parameter |
thres |
Real-valued threshold (location) parameter |
log, log.p |
Logical: if |
lower.tail |
Logical: if |
The three-parameter Weibull is a location-shifted version of the standard
two-parameter Weibull. Let Y = X - \gamma; then Y \sim
\mathrm{Weibull}(\beta, \alpha). The PDF for x > \gamma is
f(x) = \frac{\beta}{\alpha}
\left(\frac{x - \gamma}{\alpha}\right)^{\beta - 1}
\exp\!\left[-\left(\frac{x - \gamma}{\alpha}\right)^{\beta}\right].
Internally these functions shift x by thres and delegate to
dweibull, pweibull,
qweibull, and rweibull.
dweibull3pNumeric vector of density values.
pweibull3pNumeric vector of probabilities.
qweibull3pNumeric vector of quantiles.
rweibull3pNumeric vector of random samples.
Karuna G. Reddy karuna.reddy@auckland.ac.nz
M. G. M. Khan mgm.khan@usp.ac.fj
dweibull for the two-parameter Weibull;
fitverse with dists = "weibull3" to fit this
distribution by MLE.
## PDF and CDF
curve(dweibull3p(x, shape = 2, scale = 10, thres = 5),
from = 5, to = 35, ylab = "Density",
main = "Weibull(2, 10) shifted by 5")
## Quantile / CDF round-trip
p <- c(0.1, 0.5, 0.9)
q <- qweibull3p(p, shape = 2, scale = 10, thres = 5)
pweibull3p(q, shape = 2, scale = 10, thres = 5) # should recover p
## Random samples
set.seed(1)
x <- rweibull3p(200, shape = 1.8, scale = 50, thres = 10)
hist(x, breaks = 20, main = "Weibull(1.8, 50) with threshold 10")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.