IW: The Inverse Weibull Distribution

Description Usage Arguments Details Value Examples

Description

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

Usage

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

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

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

rIW(n, alpha, theta)

hIW(x, alpha, theta)

Arguments

x,q

vector of quantiles.

alpha

parameter one.

theta

parameter two.

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 inverse weibull distribution with parameters alpha and theta has density given by

f(x) = alpha*theta*x^(-theta-1)*exp(-alpha*(x^-theta)),

for x > 0.

Value

dIW gives the density, pIW gives the distribution function, qIW gives the quantile function, rIW generates random deviates and hIW 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(dIW(x, alpha = 5, theta = 2.5), from = 0, to = 10, ylim = c(0, 0.55), col = "red", las = 1, ylab = "The probability density function")

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

## The random function
hist(rIW(n = 1000, alpha = 5, theta = 2.5), freq = FALSE, xlab = "x", ylim = c(0, 0.55), las = 1, main = "")
curve(dIW(x, alpha = 5, theta = 2.5),  from = 0, to = 10, add = TRUE, ylim = c(0, 0.55), col = "red")

## The Hazard function
curve(hIW(x, alpha = 5, theta = 2.5), from = 0, to = 15, ylim = c(0, 1), col = "red", las = 1, ylab = "The Hazard function")

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