Skip to contents

Get beta distribution's two shape parameters from mean value and variance.

Usage

get_beta_parameters(mu, sigmasq)

Arguments

mu

mean value

sigmasq

variance

Examples

a <- 2
b <- 6
m <- a / (a + b)
v <- (a*b)/((a+b)^2 * (a + b +1))
get_beta_parameters(m, v)
#> Error in get_beta_parameters(m, v): could not find function "get_beta_parameters"
# p <- get_beta_parameters(0.1, 0.01); curve(dbeta(x, p[1], p[2]), from = 0, to = 1)
# p <- get_beta_parameters(0.1, 0.001); curve(dbeta(x, p[1], p[2]), from = 0, to = 1)
# p <- get_beta_parameters(0.1, 0.0001); curve(dbeta(x, p[1], p[2]), from = 0, to = 1)