FWE: The Flexible Weibull Extension Distribution

Description Usage Arguments Details Value Examples

Description

Density, distribution function, quantile function, random generation and hazard function for the flexible weibull extension distribution with parameters alpha and beta.

Usage

1
2
3
4
5
6
7
8
9
dFWE(x, alpha, beta, log = FALSE)

pFWE(q, alpha, beta, lower.tail = TRUE, log.p = FALSE)

qFWE(p, alpha, beta, lower.tail = TRUE, log.p = FALSE)

rFWE(n, alpha, beta)

hFWE(x, alpha, beta)

Arguments

x,q

vector of quantiles.

alpha

parameter.

beta

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 flexible weibull extension with parameters alpha and beta has density given by

f(x) = (alpha + (beta/x^2))*exp(alpha*x - beta/x)*exp(-exp(alpha*x-beta/x))

for x>0.

Value

dFWE gives the density, pFWE gives the distribution function, qFWE gives the quantile function, rFWE generates random deviates and hFWE 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(dFWE(x, alpha = 0.75, beta = 0.5), from = 0, to = 3, ylim = c(0, 1.7), col = "red", las = 1, ylab = "The probability density function")

## The cumulative distribution and the Reliability function
par(mfrow = c(1, 2))
curve(pFWE(x, alpha = 0.75, beta = 0.5), from = 0, to = 3, col = "red", las = 1, ylab = "The cumulative distribution function")
curve(pFWE(x, alpha = 0.75, beta = 0.5, lower.tail = FALSE), from = 0, to = 3, col = "red", las = 1, ylab = "The Reliability function")

## The quantile function
p <- seq(from = 0, to = 0.99999, length.out = 100)
plot(x = qFWE(p,alpha = 0.75, beta = 0.5), y = p, xlab = "Quantile", las = 1, ylab = "Probability")
curve(pFWE(x, alpha = 0.75, beta = 0.5), from = 0, add = TRUE, col = "red")

## The random function
hist(rFWE(n = 1000, alpha = 2, beta = 0.5), freq = FALSE, xlab = "x", ylim = c(0, 2), las = 1, main = "")
curve(dFWE(x, alpha = 2, beta = 0.5),  from = 0, to = 3, add = TRUE, , col = "red")

## The Hazard function
curve(hFWE(x, alpha = 0.75, beta = 0.5), from = 0, to = 2, ylim = c(0, 2.5), col = "red", ylab = "The Hazard function", las = 1)

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