TLindley: Transmuted Lindley Distribution

Description Usage Arguments Details Value Note Author(s) Source References See Also Examples

Description

Density function, distribution function, quantile function, random number generation and hazard rate function for the transmuted Lindley distribution with parameters theta and alpha.

Usage

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

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

qtlindley(p, theta, alpha, lower.tail = TRUE, log.p = FALSE, L = 1e-04,
  U = 50)

rtlindley(n, theta, alpha, L = 1e-04, U = 50)

htlindley(x, theta, alpha, log = FALSE)

Arguments

x, q

vector of positive quantiles.

theta

positive parameter.

alpha

-1 ≤q α ≤q +1.

log, log.p

logical; If TRUE, probabilities p are given as log(p).

lower.tail

logical; If TRUE, (default), P(X ≤q x) are returned, otherwise P(X > x).

p

vector of probabilities.

L, U

interval which uniroot searches for a root (quantile), L = 1e-4 and U = 50 are the default values.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

Details

Probability density function

f(x\mid θ ,α )={\frac{{θ }^{2}≤ft( 1+x\right) e{^{-θ x}}}{1+θ }≤ft[ 1-α +2α ≤ft( 1+{\frac{θ x}{1+θ }}\right) e{^{-θ x}}\right] }

Cumulative distribution function

F(x\mid θ ,α )=≤ft( 1+α \right) ≤ft[ 1-≤ft( 1+{\frac{θ x}{1+θ }}\right) e{^{-θ x}}\right] -α ≤ft[1-≤ft( 1+{\frac{θ x}{1+θ }}\right) e{^{-θ x}}\right]^{2}

Quantile function

\code{does not have a closed mathematical expression}

Hazard rate function

h(x\mid θ ,α )={\frac{{θ }^{2}≤ft( 1+x\right) e{^{-θ x}≤ft[ 1-α +2α ≤ft( 1+{\frac{θ x}{1+θ }} \right) e{^{-θ x}}\right] }}{≤ft( 1+θ \right) ≤ft\{ ≤ft( 1+α \right) ≤ft[ 1-≤ft( 1+{\frac{θ x}{1+θ }}\right) e{^{-θ x}}\right] -α ≤ft[ 1-≤ft( 1+{\frac{θ x}{1+θ }}\right) e{^{-θ x}}\right] ^{2}\right\} }}

Particular case: α = 0 the one-parameter Lindley distribution.

Value

dtlindley gives the density, ptlindley gives the distribution function, qtlindley gives the quantile function, rtlindley generates random deviates and htlindley gives the hazard rate function.

Invalid arguments will return an error message.

Note

The uniroot function with default arguments is used to find out the quantiles.

Author(s)

Josmar Mazucheli jmazucheli@gmail.com

Larissa B. Fernandes lbf.estatistica@gmail.com

Source

[d-h-p-q-r]tlindley are calculated directly from the definitions. rtlindley uses the quantile function.

References

Merovci, F., (2013). Transmuted Lindley distribution. International Journal of Open Problems in Computer Science and Mathematics, 63, (3), 63-72.

See Also

uniroot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
set.seed(1)
x <- rtlindley(n = 1000, theta = 1.5, alpha = 0.5)
R <- range(x)
S <- seq(from = R[1], to = R[2], by = 0.1)
plot(S, dtlindley(S, theta = 1.5, alpha = 0.5), xlab = 'x', ylab = 'pdf')
hist(x, prob = TRUE, main = '', add = TRUE)

p <- seq(from = 0.1, to = 0.9, by = 0.1)
q <- quantile(x, prob = p)
ptlindley(q, theta = 1.5, alpha = 0.5, lower.tail = TRUE)
ptlindley(q, theta = 1.5, alpha = 0.5, lower.tail = FALSE)
qtlindley(p, theta = 1.5, alpha = 0.5, lower.tail = TRUE)
qtlindley(p, theta = 1.5, alpha = 0.5, lower.tail = FALSE)

library(fitdistrplus)
fit <- fitdist(x, 'tlindley', start = list(theta = 1.5, alpha = 0.5))
plot(fit)

LindleyR documentation built on May 19, 2017, 8:01 a.m.

Search within the LindleyR package
Search all R packages, documentation and source code