Density, distribution function, quantile function and random generation for a log normal distribution whose arithmetic mean equals to mean and standard deviation equals to sd.
dlnormb(x, mean = exp(0.5), sd = sqrt(exp(2) - exp(1)), log = FALSE)plnormb(
q,
mean = exp(0.5),
sd = sqrt(exp(2) - exp(1)),
lower.tail = TRUE,
log.p = FALSE
)
qlnormb(
p,
mean = exp(0.5),
sd = sqrt(exp(2) - exp(1)),
lower.tail = TRUE,
log.p = FALSE
)
rlnormb(n, mean = exp(0.5), sd = sqrt(exp(2) - exp(1)))
dlnormb gives the density, plnormb gives the distribution function, qlnormb gives the quantile function, and rlnormb generates random deviates. The length of the result is determined by n for rlnorm, and is the maximum of the lengths of the numerical arguments for the other functions. The numerical arguments other than n are recycled to the length of the result. Only the first elements of the logical arguments are used.
The default mean and sd are chosen to provide a distribution close to a lognormal with meanlog = 0 and sdlog = 1.
vector of quantiles.
the mean of the distribution.
the standard deviation of the distribution.
logical. if `TRUE` probabilities `p` are given as `log(p)`.
logical. if `TRUE`, probabilities are \(P[X \le x]\), otherwise, \(P[X > x]\).
vector of probabilities.
number of observations. If `length(n) > 1`, the length is taken to be the number required.
This function calls the corresponding density, distribution function, quantile function and random generation
from the log normal (see Lognormal
) after evaluation of \(meanlog = log(mean^2 / sqrt(sd^2+mean^2))\) and
\(sqrt{(log(1+sd^2/mean^2))}\)
x <- rlnormb(1E5,3,6)
mean(x)
sd(x)
dlnormb(1) == dnorm(0)
dlnormb(1) == dlnorm(1)
Run the code above in your browser using DataLab