write_JAGS_model creates "MixSIAR_model.txt", which is passed to JAGS by run_model when the "RUN MODEL" button is clicked in the GUI. Several model options will have already been specified when loading the mix and source data, but here is where the error term options are selected:

  1. Residual * Process (resid_err = TRUE, process_err = TRUE)

  2. Residual only (resid_err = TRUE, process_err = FALSE)

  3. Process only (resid_err = FALSE, process_err = TRUE)

write_JAGS_model(
  filename = "MixSIAR_model.txt",
  resid_err = TRUE,
  process_err = TRUE,
  mix,
  source
)

Arguments

filename

the JAGS model file is saved in the working directory as 'filename' (default is "MixSIAR_model.txt", but user can specify).

resid_err

T/F: include residual error in the model?

process_err

T/F: include process error in the model?

mix

output from load_mix_data

source

output from load_source_data

Details

WARNING messages are displayed if:

  • resid_err = FALSE and process_err = FALSE are both selected.

  • N=1 mix data point and did not choose "Process only" error model (MixSIR)

  • Fitting each individual mix data point separately as a Fixed Effect, but did not choose "Process only" error model (MixSIR).