Description Usage Arguments Details Value Examples
This function slightly generalizes the basic rbeta
function,
allowing translation and dilatation with support
and
truncation with trunc
. Also the retained parameterization with
expectation mu
and coefficient of variation coefvar
encompasses some degenerate cases.
When the intersection of
support
and trunc
is empty, an error is issued.
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.
Be aware that giving some of the mu
either equal to support[1]
or equal to support[2]
will
imply draws fixed to this value if it belongs to the truncation
interval (NA
otherwise). So an extreme value for mu
means that it is sure, not compensated by coefvar
. We advise
not to introduce such degenerate cases.
1 |
mu |
numeric vector of the expectation of the beta, must be in
the interval defined by |
coefvar |
numeric vector of the coefficient of variation. Must be comprised between 0 and 100. |
support |
The two limits of the interval for which the beta is defined (equivalent to a translation and dilatation). The support interval is common for all draws. |
trunc |
The two limits to which distribution is truncated. The
truncation interval is common for all draws. In fact, it is computed
as the intersection with |
The proposed parameterization is given by the following relationships
with the standard a
and b
parameters when
support=c(0,1)
.
mu = a / (a+b)
and coefvar =
200 / (a+b)
,
a = 200 * (mu / coefvar)
and b = 200 *
((1-mu)/coefvar)
.
When mu
is equal to support[1]
or
support[2]
, this is a degenerate case considered as fixed with
coefvar
is null whatever is the provided value.
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.