Description Usage Arguments Details Value Examples
When provided the minimum and maximum values corresponding to the prior information on a parameter (within [0, 1]), the function returns the shape parameters of the beta distribution, namely alpha and beta, that covers this range.
1 | beta.parameter(low, up)
|
low |
numeric argument. Lower bound of the range |
up |
numeric argument. Upper bound of the range |
The low
argument must always be less than the up
argument. Also, both low
and up
arguments must remain within [0, 1].
It returns a list object consisting of the shape parameters alpha
and beta
of the Beta distribution such that
alpha/(alpha + beta) = (low + up)/2
and
(alpha*beta)/( (alpha + beta)^2 (alpha + beta + 1)) = (up - low)/4
The function has been built such that the particular case where low = up = 1 will return alpha = beta = 1.
1 2 3 4 5 6 7 8 9 |
## Not run: beta.parameter(-1, 0.5) #Returns error!
## Not run: beta.parameter(0, 0) #Not allowed. Returns error!
## Not run: beta.parameter(0.75, 0.25) #Returns error!
beta.parameter(0, 1)
beta.parameter(0.5, 1)
beta.parameter(0.1, 0.7)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.