Learn R Programming

extraDistr (version 1.10.0)

Lomax: Lomax distribution

Description

Density, distribution function, quantile function and random generation for the Lomax distribution.

Usage

dlomax(x, lambda, kappa, log = FALSE)

plomax(q, lambda, kappa, lower.tail = TRUE, log.p = FALSE)

qlomax(p, lambda, kappa, lower.tail = TRUE, log.p = FALSE)

rlomax(n, lambda, kappa)

Arguments

x, q

vector of quantiles.

lambda, kappa

positive valued parameters.

log, log.p

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

lower.tail

logical; if TRUE (default), probabilities are \(P[X \le x]\) otherwise, \(P[X > x]\).

p

vector of probabilities.

n

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

Details

Probability density function $$ f(x) = \frac{\lambda \kappa}{(1+\lambda x)^{\kappa+1}} $$

Cumulative distribution function $$ F(x) = 1-(1+\lambda x)^{-\kappa} $$

Quantile function $$ F^{-1}(p) = \frac{(1-p)^{-1/\kappa} -1}{\lambda} $$

Examples

Run this code

x <- rlomax(1e5, 5, 16)
hist(x, 100, freq = FALSE)
curve(dlomax(x, 5, 16), 0, 1, col = "red", add = TRUE, n = 5000)
hist(plomax(x, 5, 16))
plot(ecdf(x))
curve(plomax(x, 5, 16), 0, 1, col = "red", lwd = 2, add = TRUE)

Run the code above in your browser using DataLab