Creates initial values for priors in a 'JAGS' model.

JAGS_get_inits(prior_list, chains, seed)

Arguments

prior_list

named list of prior distribution (names correspond to the parameter names)

chains

number of chains

seed

seed for random number generation: a number between -.Machine$integer.max and .Machine$integer.max. The initial values are drawn after set.seed(seed); each chain's .RNG.seed is drawn from the same seed with sample.int(.Machine$integer.max, chains), so the seed of a chain does not depend on the number of chains. The caller's random-number state (.Random.seed and RNGkind()) is restored afterwards. With seed = NULL, the seed is first drawn from the caller's random-number stream with sample(666666, 1), which advances that stream by this one draw.

Value

JAGS_get_inits returns a list with one element per chain, containing the chain's JAGS initial values and its .RNG.name and .RNG.seed. The generator is "base::Super-Duper" for up to four chains and "lecuyer::RngStream" for more chains, so the streams of a fit change when it is run with more than four chains. With an empty prior_list, each element contains only .RNG.name and .RNG.seed, so that fits of models whose priors are specified only in the model syntax remain reproducible.