MWEx: The Modified Weibull Extension Distribution

Description Usage Arguments Details Value Examples

Description

Density, distribution function, quantile function, random generation and hazard function for the modified weibull extension distribution with parameters alpha, beta and lambda.

Usage

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

pMWEx(q, alpha, beta, lambda, lower.tail = TRUE, log.p = FALSE)

qMWEx(p, alpha, beta, lambda, lower.tail = TRUE, log.p = FALSE)

rMWEx(n, alpha, beta, lambda)

hMWEx(x, alpha, beta, lambda)

Arguments

x,q

vector of quantiles.

alpha

parameter one.

beta

parameter two.

lambda

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.

Details

The modified weibull extension distribution with parameters alpha, beta and lambda has density given by

f(x) = lambda*beta*((x/alpha)^(beta-1))*exp((x/alpha)^beta + lambda*alpha*(1-exp((x/alpha)^beta)))

for x > 0.

Value

dMWEx gives the density, pMWEx gives the distribution function, qMWEx gives the quantile function, rMWEx generates random deviates and hMWEx 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(dMWEx(x, alpha = 1/0.5, beta = 3, lambda = 2), from = 0, to = 2.5, ylim = c(0, 1.5), col = "red", las = 1, ylab = "The probability density function")

## The cumulative distribution and the Reliability function
par(mfrow = c(1, 2))
curve(pMWEx(x, alpha = 1/0.5, beta = 3, lambda = 2), from = 0, to = 2.5, ylim = c(0, 1), col = "red", las = 1, ylab = "The cumulative distribution function")
curve(pMWEx(x, alpha = 1/0.5, beta = 3, lambda = 2,  lower.tail = FALSE), from = 0, to = 2.5, ylim = c(0, 1), col = "red", las = 1, ylab = "The Reliability function")

## The quantile function
p <- seq(from = 0, to = 0.998, length.out = 100)
plot(x = qMWEx(p, alpha = 1/0.5, beta = 3, lambda = 2), y = p, xlab = "Quantile", las = 1, ylab = "Probability")
curve(pMWEx(x, alpha = 1/0.5, beta = 3, lambda = 2), from = 0, add = TRUE, col = "red")

## The random function
hist(rMWEx(n = 10000, alpha = 1/0.5, beta = 3, lambda = 2), freq = FALSE, ylim = c(0, 1.5), xlab = "x", las = 1, main = "")
curve(dMWEx(x, alpha = 1/0.5, beta = 3, lambda = 2),  from = 0, ylim = c(0, 2.5), add = T, col = "red")

## The Hazard function
curve(hMWEx(x, alpha = 1/0.5, beta = 3, lambda = 2), from = 0, to = 1.7, ylim = c(0, 12), col = "red", ylab = "The hazard function", las = 1)

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