PL: The Power Lindley Distribution

Description Usage Arguments Details Value Examples

Description

Density, distribution function, quantile function, random generation and hazard function for the power Lindley distribution with parameters alpha and beta.

Usage

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

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

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

rPL(n, alpha, beta)

hPL(x, alpha, beta)

Arguments

x,q

vector of quantiles.

alpha

shape parameter.

beta

scale 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 power Lindley distribution with parameters alpha and beta has density given by

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

for x > 0.

Value

dPL gives the density, pPL gives the distribution function, qPL gives the quantile function, rPL generates random deviates and hPL 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(dPL(x, alpha = 1, beta = 0.5), from = 0, to = 15, ylim = c(0, 0.25), col = "red", las = 1, ylab = "The probability density function")

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

## The random function
hist(rPL(n = 1000, alpha = 1, beta = 0.5), freq = FALSE, , ylim = c(0, 0.25), xlab = "x", las = 1, main = "")
curve(dPL(x, alpha = 1, beta = 0.5),  from = 0, add = T, col = "red", ylim = c(0, 0.25))

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

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