fit_normal_prior: Fit normal distribution to MCMC output

View source: R/priors.R

fit_normal_priorR Documentation

Fit normal distribution to MCMC output

Description

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

Usage

fit_normal_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

fit_normal_prior #' @examples ## Not run: ## Output from a previous serosolver chain chain <- read.csv("madeup_chain.csv") results <- fit_normal_prior(chain, par_name="mu",plot_fit=FALSE) ## End(Not run)

Other priors: calc_phi_probs_indiv(), calc_phi_probs_spline(), calc_phi_probs(), create_prob_shifts(), find_beta_prior_mode(), find_beta_prior_with_mean_var(), find_beta_prior_with_mean(), fit_beta_prior(), inf_mat_prior(), infection_history_prior(), prob_shifts()


seroanalytics/serosolver documentation built on Dec. 14, 2024, 5:33 a.m.