dKW: 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 mu, sigma, nu and tau.

Usage

1
2
3
4
5
6
7
8
9
dKW(x, mu, sigma, nu, tau, log = FALSE)

pKW(q, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE)

qKW(p, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE)

rKW(n, mu, sigma, nu, tau)

hKW(x, mu, sigma, nu, tau)

Arguments

x, q

vector of quantiles.

mu

parameter.

sigma

parameter.

nu

parameter.

tau

parameter.

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 Distribution with parameters mu, sigma, nu and tau has density given by

f(x)=ν τ μ σ x^{σ - 1} \exp^{-μ x ^σ} [1 - \exp^{-μ x ^ σ}]^{ν-1}[1-(1-\exp^{-μ x ^ σ})^ν]^{τ-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
20
21
22
23
24
25
26
## The probability density function
curve(dKW(x, mu=3, sigma=0.8, nu=2.0, tau=1.5), from=0, to=2,
      ylim=c(0, 2.5), col="red", las=1, ylab="f(x)")

## The cumulative distribution and the Reliability function
par(mfrow=c(1, 2))
curve(pKW(x, mu=3, sigma=0.8, nu=2.0, tau=1.5),
      from=0, to=2,  col="red", las=1, ylab="F(x)")
curve(pKW(x, mu=3, sigma=0.8, nu=2.0, tau=1.5, lower.tail=FALSE),
      from=0, to=2, col="red", las=1, ylab="S(x)")

## The quantile function
p <- seq(from=0, to=0.99999, length.out=100)
plot(x=qKW(p, mu=3, sigma=0.8, nu=2.0, tau=1.5), y=p, xlab="Quantile",
     las=1, ylab="Probability")
curve(pKW(x, mu=3, sigma=0.8, nu=2.0, tau=1.5), from=0, add=TRUE, col="red")

## The random function
hist(rKW(n=10000, mu=3, sigma=0.8, nu=2.0, tau=1.5), freq=FALSE,
     xlab="x", las=1, main="")
curve(dKW(x, mu=3, sigma=0.8, nu=2.0, tau=1.5), from=0, add=TRUE, col="red")

## The Hazard function
par(mfrow=c(1,1))
curve(hKW(x, mu=3, sigma=0.8, nu=2.0, tau=1.5), from=0, to=2, ylim=c(0, 7),
      col="red", ylab="Hazard function", las=1)

vagarciave/pruebas documentation built on July 2, 2019, 12:17 a.m.