Attempts to fit a normal distribution to a data frame of MCMC output from a previous run.
fit_normal_prior(
chain_samples,
par_name = "",
error_tol = 999999999,
try_attempts = 10,
plot_fit = TRUE
)numeric vector of posterior samples to fit
optional parameter name used in the plot title
tolerance for the optimisation error
maximum number of fitting attempts before giving up
if TRUE, plots the fitted distribution against the posterior density
the model fit object returned by `optim`, or a list with missing parameters if fitting fails
fit_normal_prior
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(),
find_beta_prior_with_mean_var(),
fit_beta_prior(),
inf_mat_prior(),
infection_history_prior(),
prob_shifts()
if (FALSE) { # \dontrun{
## Posterior draws from a previous serosolver chain
chain <- rnorm(100, mean = 0, sd = 1)
results <- fit_normal_prior(chain, par_name="mu",plot_fit=FALSE)
} # }