KW: The Kumaraswamy Weibull Distribution

Description Usage Arguments Details Value Examples

Description

Density, distribution function, quantile function, random generation and hazard function for the kumaraswamy weibull distribution with parameters alpha, theta, a and b.

Usage

1
2
3
4
5
6
7
8
9
dKW(x, alpha, theta, a, b, log = FALSE)

pKW(q, alpha, theta, a, b, lower.tail = TRUE, log.p = FALSE)

qKW(p, alpha, theta, a, b, lower.tail = TRUE, log.p = FALSE)

rKW(n, alpha, theta, a, b)

hKW(x, alpha, theta, a, b)

Arguments

x,q

vector of quantiles.

alpha

parameter one.

theta

parameter two.

a

parameter three.

b

parameter four.

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 kumaraswamy weibull with parameters alpha, theta, a and b has density given by

f(x)=a*b*alpha*theta*x^(theta-1)*exp(-alpha*x^theta)*(1-exp(-alpha*x^theta))^(a-1)* (1-(1-exp(-aplha*x^theta))^a)^(b-1)

for x>0.

Value

dKW gives the density, pKW gives the distribution function, qKW gives the quantile function, rKW generates random deviates and hKW 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(dKW(x, alpha = 3, theta = 0.8, a = 2, b = 1.5), from = 0, to = 3, 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(pKW(x, alpha = 3, theta = 0.8, a = 2, b = 1.5), from = 0, to = 3, ylim = c(0, 1), col = "red", las = 1, ylab = "The cumulative distribution function")
curve(pKW(x, alpha = 3, theta = 0.8, a = 2, b = 1.5, lower.tail = FALSE), from = 0, to = 3, ylim = c(0, 1), col = "red", las = 1, ylab = "The Reliability function")

## The quantile function
p <- seq(0,0.99999, length.out=100)
plot(x=qKW(p, alpha = 3, theta = 0.8, a = 2, b = 1.5), y = p, xlab = "Quantile", las = 1, ylab = "Probability")
curve(pKW(x, alpha = 3, theta = 0.8, a = 2, b = 1.5), from = 0, add = TRUE, col = "red")

## The random function
hist(rKW(10000, alpha = 3, theta = 0.8, a = 2, b = 1.5), freq = FALSE, xlab = "x", las = 1, ylim = c(0, 2.5), main = "")
curve(dKW(x, alpha = 3, theta = 0.8, a = 2, b = 1.5),  from = 0, add = TRUE, col = "red" )

## The Hazard function
curve(hKW(x, alpha = 3, theta = 0.8, a = 2, b = 1.5), from = 0, to = 2.1, ylim = c(0, 4), col = "red", ylab = "The Hazard function", las = 1)

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