Learn R Programming

VGAM (version 0.8-4.1)

Log: Logarithmic Distribution

Description

Density, distribution function, and random generation for the logarithmic distribution.

Usage

dlog(x, prob, log = FALSE)
plog(q, prob, log.p = FALSE)
rlog(n, prob, Smallno = 1.0e-6)

Arguments

x, q
Vector of quantiles. For the density, it should be a vector with positive integer values in order for the probabilities to be positive.
n
number of observations. A single positive integer.
prob
The parameter value $c$ described in in logff. Here it is called prob because $0rlog() this parameter must be of length 1.
log, log.p
Logical. If log.p = TRUE then all probabilities p are given as log(p).
Smallno
Numeric, a small value used by the rejection method for determining the upper limit of the distribution. That is, plog(U, prob) > 1-Smallno where U is the upper limit.

Value

  • dlog gives the density, plog gives the distribution function, and rlog generates random deviates.

Details

The details are given in logff.

References

Evans, M., Hastings, N. and Peacock, B. (2000) Statistical Distributions, New York: Wiley-Interscience, Third edition.

See Also

logff.

Examples

Run this code
dlog(1:20, 0.5)
rlog(20, 0.5)

prob = 0.8; x = 1:10
plot(x, dlog(x, prob = prob), type = "h", ylim = 0:1,
     sub = "prob=0.8", las = 1, col = "blue", ylab = "Probability",
     main="Logarithmic distribution: blue=density; red=distribution function")
lines(x + 0.1, plog(x, prob = prob), col = "red", lty = 3, type = "h")

Run the code above in your browser using DataLab