run_model calls JAGS to run the mixing model created by write_JAGS_model. This happens when the "RUN MODEL" button is clicked in the GUI.

run_model(
  run,
  mix,
  source,
  discr,
  model_filename,
  alpha.prior = 1,
  resid_err = NULL,
  process_err = NULL
)

Arguments

run

list of MCMC parameters (chainLength, burn, thin, chains, calcDIC). Alternatively, a user can use a pre-defined parameter set by specifying a valid string:

  • "test": chainLength=1000, burn=500, thin=1, chains=3

  • "very short": chainLength=10000, burn=5000, thin=5, chains=3

  • "short": chainLength=50000, burn=25000, thin=25, chains=3

  • "normal": chainLength=100000, burn=50000, thin=50, chains=3

  • "long": chainLength=300000, burn=200000, thin=100, chains=3

  • "very long": chainLength=1000000, burn=500000, thin=500, chains=3

  • "extreme": chainLength=3000000, burn=1500000, thin=500, chains=3

mix

output from load_mix_data

source

output from load_source_data

discr

output from load_discr_data

model_filename

name of JAGS model file (usually should match filename input to write_JAGS_model).

alpha.prior

Dirichlet prior on p.global (default = 1, uninformative)

resid_err

include residual error in the model? (no longer used, read from `model_filename`)

process_err

include process error in the model? (no longer used, read from `model_filename`)

Value

jags.1, a rjags model object

Note: Tracer values are normalized before running the JAGS model. This allows the same priors to be used regardless of scale of the tracer data, without using the data to select the prior (i.e. by setting the prior mean equal to the sample mean). Normalizing the tracer data does not affect the proportion estimates (p_k), but does affect users seeking to plot the posterior predictive distribution for their data. For each tracer, we calculate the pooled mean and standard deviation of the mix and source data, then subtract the pooled mean and divide by the pooled standard deviation from the mix and source data. For details, see lines 226-269.