run_mcmc: Run Bayesian Model for Se and Sp

Description Usage Arguments Value Examples

Description

A function that takes in settings for a JAGS run, and parameter settings. Function writes model based on which parameters we are choosing to model, runs JAGS and saves tibbles of MCMC values per simulations. The MCMC tibbles are saved to the output folder by simulation number out of Nsim simulations. Last, there are traceplots and convergence information saved to output folder as part of coda package output.

Usage

1
2
run_mcmc(runname, Nchains, Niter, i, modelonegammatrue, modelgammatruect,
  simsetting)

Arguments

runname

Extension to output folder that describes run setting, ie alldata.

Nchains

Number of chains ran by JAGS.

Niter

Number of iterations per chain ran by JAGS.

i

#Simulation number out of Nsim.

modelonegammatrue

Indicator (TRUE or FALSE) if the model includes one parameter for gammatruematvr.

modelgammatruect

Indicator (TRUE or FALSE) if the model includes unique country-year parametes for gammatruematvr.

simsetting

Describes simulation setting.

Value

Takes in jags inputs from run_simulation. Writes and runs specified model. Outputs a tibble of MCMC samples (for all parnames listed below) for the given simulation.

Examples

1
run_mcmc(runname = "test", Nchains = 1, Niter = 10, i=1, modelonegammatrue = T, modelgammatruect = F, simsetting = "test")

Enpeterson/outputsim documentation built on May 24, 2019, 9:53 a.m.