OW: The Odd Weibull Distribution

Description Usage Arguments Details Value Examples

Description

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

Usage

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

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

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

rOW(n, alpha, theta, lambda)

hOW(x, alpha, theta, lambda)

Arguments

x,q

vector of quantiles.

alpha

parameter one.

theta

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 generalized power weibull with parameters alpha, theta and lambda has density given by

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

for x > 0.

Value

dOW gives the density, pOW gives the distribution function, qOW gives the quantile function, rOW generates random deviates and hOW 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(dOW(x, alpha = 2, theta = 3, lambda = 0.2), from = 0, to = 4, ylim = c(0, 2), col = "red", las = 1, ylab = "The probability density function")

## The cumulative distribution and the Reliability function
par(mfrow = c(1, 2))
curve(pOW(x, alpha = 2, theta = 3, lambda = 0.2), from = 0, to = 4, ylim = c(0, 1), col = "red", las = 1, ylab = "The cumulative distribution function")
curve(pOW(x, alpha = 2, theta = 3, lambda = 0.2, lower.tail = FALSE), from = 0, to = 4,  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 = qOW(p, alpha = 2, theta = 3, lambda = 0.2), y = p, xlab = "Quantile", las = 1, ylab = "Probability")
curve(pOW(x, alpha = 2, theta = 3, lambda = 0.2), from = 0, add = TRUE, col = "red")

## The random function
hist(rOW(n = 10000, alpha = 2, theta = 3, lambda = 0.2), freq = FALSE, ylim = c(0, 2),xlab = "x", las = 1, main = "")
curve(dOW(x, alpha = 2, theta = 3, lambda = 0.2),  from = 0, ylim = c(0, 2), add = T, col = "red")

## The Hazard function
curve(hOW(x, alpha = 2, theta = 3, lambda = 0.2), from = 0, to = 2.5, ylim = c(0, 3), col = "red", ylab = "The hazard function", las = 1)

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