NMW: The Almaki and Yuan's modified Weibull distribution

Description Usage Arguments Details Value Examples

Description

Density, distribution function, quantile function, random generation and hazard function for the Almaki and Yuan's modified weibull distribution with parameters alpha, beta, theta, gamma and lambda.

Usage

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

pNMW(q, alpha, beta, theta, gamma, lambda, lower.tail = TRUE, log.p = FALSE)

qNMW(p, alpha, beta, theta, gamma, lambda, lower.tail = TRUE, log.p = FALSE)

rNMW(n, alpha, beta, theta, gamma, lambda)

hNMW(x, alpha, beta, theta, gamma, lambda, log = FALSE)

Arguments

x,q

vector of quantiles.

alpha

parameter one.

beta

parameter two.

theta

parameter three.

gamma

parameter four.

lambda

parameter five.

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 Almaki and Yuans modified weibull with parameters alpha, beta, theta, gamma and lambda has density given by

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

for x>0.

Value

dNMW gives the density, pNMW gives the distribution function, qNMW gives the quantile function, rNMW generates random deviates and hNMW 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(dNMW(x, alpha = 1.15, beta = 0.15, theta = 0.75, gamma = 5, lambda = 2), from = 0, to = 1.4, ylim = c(0, 3), col = "red", las = 1, ylab = "The probability density function")

## The cumulative distribution and the Reliability function
par(mfrow = c(1, 2))
curve(pNMW(x, alpha = 1.15, beta = 0.15, theta = 0.75, gamma = 5, lambda = 2), from = 0, to = 1.4, col = "red", las = 1, ylab = "The cumulative distribution function")
curve(pNMW(x, alpha = 1.15, beta = 0.15, theta = 0.75, gamma = 5, lambda = 2, lower.tail = FALSE), from = 0, to = 1.4, col = "red", las = 1, ylab = "The Reliability function")

## The quantile function
p <- seq(from = 0, to = 0.998, length.out = 100)
plot(x=qNMW(p, alpha = 1.15, beta = 0.15, theta = 0.75, gamma = 5, lambda = 2), y = p, xlab = "Quantile", las = 1, ylab = "Probability")
curve(pNMW(x, alpha = 1.15, beta = 0.15, theta = 0.75, gamma = 5, lambda = 2), from = 0, add = TRUE, col = "red")

## The random function
hist(rNMW(n = 1000, alpha = 1.15, beta = 0.15, theta = 0.75, gamma = 5, lambda = 2), freq = FALSE, ylim = c(0, 3), xlab = "x", las = 1, main = "")
curve(dNMW(x, alpha = 1.15, beta = 0.15, theta = 0.75, gamma = 5, lambda = 2),  from = 0, ylim = c(0, 3), add = T, col = "red")

## The Hazard function
curve(hNMW(x, alpha = 1.15, beta = 0.15, theta = 0.75, gamma = 5, lambda = 2), from = 0, to = 1.5, ylim = c(0, 8), col = "red", ylab = "The hazard function", las = 1)

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