Description Usage Arguments Details Value Examples
Density, distribution function, quantile function,
random generation and hazard function for Sarhan and Zaindins modified weibull distribution with
parameters alpha
, beta
and gamma
.
1 2 3 4 5 6 7 8 9 |
x,q |
vector of quantiles. |
alpha |
parameter one. |
beta |
parameter two. |
gamma |
parameter three. |
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 Sarhan and Zaindins modified weibull with parameters alpha
,
beta
and gamma
has density given by
f(x)=(alpha+beta*gamma*x^(gamma-1))*exp(-alpha*x-beta*x^gamma)
for x>0.
dSZMW
gives the density, pSZMW
gives the distribution
function, qSZMW
gives the quantile function, rSZMW
generates random deviates and hSZMW
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(dSZMW(x, alpha = 2, beta = 1.5, gamma = 0.2), from = 0, to = 2, ylim = c(0, 1.7), col = "red", las = 1, ylab = "The probability density function")
## The cumulative distribution and the Reliability function
par(mfrow = c(1, 2))
curve(pSZMW(x, alpha = 2, beta = 1.5, gamma = 0.2), from = 0, to = 2, ylim = c(0, 1), col = "red", las = 1, ylab = "The cumulative distribution function")
curve(pSZMW(x, alpha = 2, beta = 1.5, gamma = 0.2, lower.tail = FALSE), from = 0, to = 2, ylim = c(0, 1), col = "red", las = 1, ylab = "The Reliability function")
## The quantile function
p <- seq(from = 0, to = 0.99999, length.out = 100)
plot(x = qSZMW(p = p, alpha = 2, beta = 1.5, gamma = 0.2), y = p, xlab = "Quantile", las = 1, ylab = "Probability")
curve(pSZMW(x, alpha = 2, beta = 1.5, gamma = 0.2), from = 0, add = TRUE, col = "red")
## The random function
hist(rSZMW(n = 1000, alpha = 2, beta = 1.5, gamma = 0.2), freq = FALSE, xlab = "x", las = 1, main = "")
curve(dSZMW(x, alpha = 2, beta = 1.5, gamma = 0.2), from = 0, add = TRUE, col = "red")
## The Hazard function
curve(hSZMW(x, alpha = 2, beta = 1.5, gamma = 0.2), from = 0, to = 3, ylim = c(0, 8), col = "red", ylab = "The hazard function", las = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.