Description Usage Arguments Examples
Function takes mean and standard deviation as an argument and returns conventional alpha and beta shape parameters
1 | beta_prior(m, sd)
|
m |
Numeric. Mean of the Beta distribution |
sd |
Positive numeric. Standard deviation of the Beta distribution |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.