Finds the shape1 and shape2 parameters for a Beta distribution that gives the desired mean and variance.
find_beta_prior_with_mean_var(mean, var, make_plot = FALSE)
Arguments
- mean
the mean of the beta distribution (between 0 and 1)
- var
the variance of the beta distribution (between 0 and 0.25)
- make_plot
if TRUE, plots the resulting Beta distribution to the R device
Value
a list with shape1 and shape2
See also
Other priors:
calc_phi_probs(),
calc_phi_probs_indiv(),
calc_phi_probs_spline(),
create_prob_shifts(),
dbb_prior(),
density_beta_binom(),
find_beta_prior_mode(),
find_beta_prior_with_mean(),
fit_beta_prior(),
fit_normal_prior(),
inf_mat_prior(),
infection_history_prior(),
prob_shifts()
Examples
find_beta_prior_with_mean_var(0.15,0.1,FALSE)
#> $shape1
#> [1] 0.04125
#>
#> $shape2
#> [1] 0.23375
#>