beta_prior: Re-parametrize Mean and Standard Deviation parameters for...

Description Usage Arguments Examples

Description

Function takes mean and standard deviation as an argument and returns conventional alpha and beta shape parameters

Usage

1

Arguments

m

Numeric. Mean of the Beta distribution

sd

Positive numeric. Standard deviation of the Beta distribution

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
# Generate hyperparameters for Stan model for Origins of Electoral Systems example
q0_alpha_beta <- mapply(m = c(q.a0 = 0.1, # Assumptions on mean of q0's
                              q.b0 = 0.1,
                              q.c0 = 0.05,
                              q.d0 = 0.3),
                        sd = rep(.01, times = 4),
                        FUN = beta_prior)

q1_alpha_beta <- mapply(m = c(q.a1 = 0.95, # Assumptions on mean of q1's
                              q.b1 = 0.9,
                              q.c1 = 0.475,
                              q.d1 = 0.5),
                        sd = rep(.01, times = 4),
                        FUN = beta_prior)


## End(Not run)

macartan/biqq documentation built on May 6, 2019, 6:03 p.m.