Attempts to fit a beta distribution to a data frame of MCMC output from a previous run.

fit_beta_prior(
  chain_samples,
  par_name = "",
  error_tol = 999999999,
  try_attempts = 10,
  plot_fit = TRUE
)

Arguments

chain_samples

the MCMC chain data frame to be fit to

par_name

the column label to fit to

error_tol

= 9999999999999, what's the error tolerance on the fit? Might take some tweaking

try_attempts

= 10 how many fitting attempts to try before giving up

plot_fit

= TRUE, if TRUE, plots the fit to the MCMC chain

Value

the model fit object as returned by optim

See also

Examples

if (FALSE) { ## Output from a previous serosolver chain chain <- read.csv("madeup_chain.csv") results <- fit_beta_prior(chain, par_name="sigma1",plot_fit=FALSE) }