Description Usage Arguments Details Value Examples
Density, distribution function, quantile function,
random generation and hazard function for the exponentiated weibull distribution with
parameters alpha
, theta
and lambda
.
1 2 3 4 5 6 7 8 9 |
x,q |
vector of quantiles. |
alpha |
scale parameter. |
theta,lambda |
shape parameters. |
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]. |
p |
vector of probabilities. |
n |
number of observations. |
The Exponentiated Weibull Distribution with parameters alpha
,
theta
and lambda
has density given by
f(x)=lambda*alpha*theta*x^(theta-1)*exp(-alpha*(x^theta))*(1-exp(-alpha*(x^theta)))^(lambda-1)
for x > 0.
#'
dEW
gives the density, pEW
gives the distribution
function, qEW
gives the quantile function, rEW
generates random deviates and hEW
gives the hazard function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## The probability density function
curve(dEW(x, alpha = 2, theta = 1.5, lambda = 0.5), from = 0, to = 2, ylim = c(0, 2.5), col = "red", las = 1, ylab = "The probability density function")
## The cumulative distribution and the Reliability function
par(mfrow = c(1, 2))
curve(pEW(x, alpha = 2, theta = 1.5, lambda = 0.5), from = 0, to = 2, col = "red", las = 1, ylab = "The cumulative distribution function")
curve(pEW(x, alpha = 2, theta = 1.5, lambda = 0.5, lower.tail = FALSE), from = 0, to = 2, col = "red", las = 1, ylab = "The Reliability function")
## The quantile function
p <- seq(from = 0, to = 0.99999, length.out = 100)
plot(x = qEW(p, alpha = 2, theta = 1.5, lambda = 0.5), y = p, xlab = "Quantile", las = 1, ylab = "Probability")
curve(pEW(x, alpha = 2, theta = 1.5, lambda = 0.5), from = 0, add = TRUE, col = "red")
## The random function
hist(rEW(n = 10000, alpha = 2, theta = 1.5, lambda = 0.5), freq = FALSE, xlab = "x", las = 1, main = "")
curve(dEW(x, alpha = 2, theta = 1.5, lambda = 0.5), from = 0, add = TRUE, col = "red")
## The Hazard function
curve(hEW(x, alpha = 2,theta = 1.5, lambda = 0.5), from = 0, to = 2, ylim = c(0, 7), col = "red", ylab = "The Hazard function")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.