Create a JAGS inits suitable for use with run.jags and autorun.jags
dot-createBinomialInit.RdInitial values of p are chosen uniformly at random in the range 0.001 to 0.999 inclusive.
Arguments
- gammaA
a vector with elements named shape and scale that define the hyper prior for
ain the Beta prior forp.- gammaB
a vector with elements named shape and scale that define the hyper prior for
bin the Beta prior forp.- seed
a scalar containing the seed to be used for the init.
NULL, the default, indicates that a random seed should be used. It is not clear from the runjags or JAGS manuals what the range of permissible seed values is, but positive integers appear to be acceptable.- quantiles
Default
NULL. IfNULL, starting values ofaandbare chosen at random. Otherwise, starting values are defined by the values supplied inquantiles. See Usage Notes below.- rng
the random number generator to be used for each init
- n
the length of the initialisation vector for
p
Usage Notes
The quantiles parameter provides a flexible way of defining starting values
for the hyperparameters a and b. If NULL, the default, starting values
are random values from either gammaA (for a) or gammaB (for b).
Otherwise, quantiles should be a numeric vector of length 2 with values
(named a and b) that are both either NA or in the range (0, 1). If
NA, the corresponding staring value is chosen at random, as above. Otherwise,
if the value is x, the starting value of the hyperparameter is the xth
quantile of the corresponding Gamma distribution.
For example, if quantiles=c("a"=NA, "b"=50), then the starting value for a
is a random value drawn from the distribution defined by gammaA and the
starting value of b is the 50th centile of the distribution defined by
gammaB.