beta.parameter: A function that returns the shape parameters of the beta...

Description Usage Arguments Details Value Examples

Description

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.

Usage

1
beta.parameter(low, up) 

Arguments

low

numeric argument. Lower bound of the range

up

numeric argument. Upper bound of the range

Details

The low argument must always be less than the up argument. Also, both low and up arguments must remain within [0, 1].

Value

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.

Examples

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)            

HSROC documentation built on Sept. 19, 2019, 9:05 a.m.

Related to beta.parameter in HSROC...