MW: The Modified Weibull Distribution

Description Usage Arguments Details Value Examples

Description

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

Usage

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

pMW(q, beta, gamma, lambda, lower.tail = TRUE, log.p = FALSE)

qMW(p, beta, gamma, lambda, lower.tail = TRUE, log.p = FALSE)

rMW(n, beta, gamma, lambda)

hMW(x, beta, gamma, lambda)

Arguments

x,q

vector of quantiles.

beta

shape parameter one.

gamma

parameter two.

lambda

scale 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 distribution with parameters beta, gamma and lambda has density given by

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

for x > 0.

Value

dMW gives the density, pMW gives the distribution function, qMW gives the quantile function, rMW generates random deviates and hMW 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(dMW(x, beta = 2, gamma = 1.5, lambda = 0.2), from=0, to=2, 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(pMW(x, beta = 2, gamma = 1.5, lambda = 0.2), from = 0, to = 2, ylim = c(0, 1), col = "red", las = 1, ylab = "The cumulative distribution function")
curve(pMW(x, beta = 2, gamma = 1.5, lambda = 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.998, length.out = 100)
plot(x = qMW(p = p, beta = 2, gamma = 1.5, lambda = 0.2), y = p, xlab = "Quantile", las = 1, ylab = "Probability")
curve(pMW(x, beta = 2, gamma = 1.5, lambda = 0.2), from = 0, add = TRUE, col = "red")

## The random function
hist(rMW(n = 1000, beta = 2, gamma = 1.5, lambda = 0.2), freq = FALSE, , ylim=c(0,1.5),xlab = "x", las = 1, main = "")
curve(dMW(x, beta = 2, gamma = 1.5, lambda = 0.2), from = 0, , ylim=c(0,1.5), add = T, col = "red")

## The Hazard function
curve(hMW(x, beta = 2, gamma = 1.5, lambda = 0.2), from = 0, to = 1.5, ylim = c(0, 5), col = "red", las = 1, ylab = "The Hazard function")

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