dlunif {KScorrect} | R Documentation |
The Log Uniform Distribution
Description
Density, distribution function, quantile function and random generation for
the log uniform distribution in the interval from min
to max
.
Parameters must be raw values (not log-transformed) and will be
log-transformed using specified base
.
Usage
dlunif(x, min, max, base = exp(1))
plunif(q, min, max, base = exp(1))
qlunif(p, min, max, base = exp(1))
rlunif(n, min, max, base = exp(1))
Arguments
x |
Vector of quantiles. |
min |
Lower limit of the distribution, in raw (not log-transformed) values. Negative values will give warning. |
max |
Upper limit of the distribution, in raw (not log-transformed) values. Negative values will give warning. |
base |
The base to which logarithms are computed. Defaults to
|
q |
Vector of quantiles. |
p |
Vector of probabilities. |
n |
Number of observations. |
Details
A log uniform (or loguniform or log-uniform) random variable has a uniform distribution when log-transformed.
Value
dlunif
gives the density, plunif
gives the distribution
function, qlunif
gives the quantile function, and rlunif
generates random numbers.
Note
Parameters min, max
must be provided as raw (not
log-transformed) values and will be log-transformed using base
. In
other words, when log-transformed, a log uniform random variable with
parameters min=a
and max=b
is uniform over the interval from
log(a)
to log(b)
.
Author(s)
Steve Wang scwang@swarthmore.edu
See Also
Distributions
for other standard distributions
Examples
plot(1:100, dlunif(1:100, exp(1), exp(10)), type="l", main="Loguniform density")
plot(log(1:100), dlunif(log(1:100), log(1), log(10)), type="l",
main="Loguniform density")
plot(1:100, plunif(1:100, exp(1), exp(10)), type="l", main="Loguniform cumulative")
plot(qlunif(ppoints(100), exp(1), exp(10)), type="l", main="Loguniform quantile")
hist(rlunif(1000, exp(1), exp(10)), main="random loguniform sample")
hist(log(rlunif(10000, exp(1), exp(10))), main="random loguniform sample")
hist(log(rlunif(10000, exp(1), exp(10), base=10), base=10), main="random loguniform sample")