Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

toppleUC

The Topp-Leone Distribution


Description

Density, distribution function, quantile function and random generation for the Topp-Leone distribution.

Usage

dtopple(x, shape, log = FALSE)
ptopple(q, shape, lower.tail = TRUE, log.p = FALSE)
qtopple(p, shape)
rtopple(n, shape)

Arguments

x, q, p, n

Same as Uniform.

shape

the (shape) parameter, which lies in (0, 1).

log

Logical. If log = TRUE then the logarithm of the density is returned.

lower.tail, log.p

Same meaning as in pnorm or qnorm.

Details

See topple, the VGAM family function for estimating the (shape) parameter s by maximum likelihood estimation, for the formula of the probability density function.

Value

dtopple gives the density, ptopple gives the distribution function, qtopple gives the quantile function, and rtopple generates random deviates.

Note

The Topp-Leone distribution is related to the triangle distribution.

Author(s)

T. W. Yee

References

Topp, C. W. and F. C. Leone (1955). A family of J-shaped frequency functions. Journal of the American Statistical Association, 50, 209–219.

See Also

Examples

## Not run:  shape <- 0.7; x <- seq(0.02, 0.999, length = 300)
plot(x, dtopple(x, shape = shape), type = "l", col = "blue", las = 1,
     main = "Blue is density, orange is cumulative distribution function",
     sub = "Purple lines are the 10,20,...,90 percentiles", ylab = "")
abline(h = 0, col = "blue", lty = 2)
lines(x, ptopple(x, shape = shape), type = "l", col = "orange")
probs <- seq(0.1, 0.9, by = 0.1)
Q <- qtopple(probs, shape = shape)
lines(Q, dtopple(Q, shape), col = "purple", lty = 3, type = "h")
lines(Q, ptopple(Q, shape), col = "purple", lty = 3, type = "h")
abline(h = probs, col = "purple", lty = 3)
max(abs(ptopple(Q, shape) - probs))  # Should be zero

## End(Not run)

VGAM

Vector Generalized Linear and Additive Models

v1.1-5
GPL-3
Authors
Thomas Yee [aut, cre], Cleve Moler [ctb] (author of several LINPACK routines)
Initial release
2021-01-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.