Description Usage Arguments Details Value Examples
This function slightly generalizes the basic rlnorm
function,
allowing a different support that [0,+Inf[
with support
and truncation with trunc
.
The number of returned draws is
max(length(mu),length(coefvar))
. When both lengths are not
equal, the smaller one must be equal to one, if not an error is
issued.
NA value are possible in mu
and coefvar
,
then missing values are returned for the considered draws.
Notice
that support[2]
is not a bound, only its sign is used to know
if the support is [support[1],+Inf[
when plus or
]-Inf,support[1]
when minus.
1 |
mu |
numeric vector of the expectation of the normal (i.e. in the log scale). |
coefvar |
numeric vector of the coefficient of variation (also in the log scale). Cannot be negative. |
support |
Defines the support of the log-normal distribution.
This is either |
trunc |
The two limits (not in the log scale) to which the distribution is truncated. It will be restricted to its intersection with the support. The truncation interval is common for all draws. |
To comply with /prr/ point of view, the second parameter of the
log-normal distribution is given through the variation
coefficient.
In fact, after making the appropriate transformation,
this function calls the unormal
function. To make the code
safer, also the check of the consistency of the parameters is made by
unormal
not by ulnormal
.
The remark made for
unormal
applies to this function too (since it is called).
This can generate missing values (NA
) for too small mu
components.
A vector of the drawn values, possibly containing NA
.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.