EW: The Exponentiated Weibull Distribution

Description Usage Arguments Details Value Examples

Description

Density, distribution function, quantile function, random generation and hazard function for the exponentiated weibull distribution with parameters alpha, theta and lambda.

Usage

1
2
3
4
5
6
7
8
9
dEW(x, alpha, theta, lambda, log = FALSE)

pEW(q, alpha, theta, lambda, lower.tail = TRUE, log.p = FALSE)

qEW(p, alpha, theta, lambda, lower.tail = TRUE, log.p = FALSE)

rEW(n, alpha, theta, lambda)

hEW(x, alpha, theta, lambda)

Arguments

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.

Details

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.

#'

Value

dEW gives the density, pEW gives the distribution function, qEW gives the quantile function, rEW generates random deviates and hEW gives the hazard function.

Examples

 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")

ousuga/reldist documentation built on May 24, 2019, 5:54 p.m.