Description Usage Arguments Value Usage notes Examples
If the class of obj
is runjags
, the mcmc
field is
extracted and processed. If runjags.list
or mcmc.list
,
tidy
calls itself recursively on each element of
obj
, row_bind()
s the results together and returns the
resulting tibble. If mcmc
, obj
is processed as described in
Usage notes below.
1 2 3 4 5 6 7 |
obj |
the object to be converted. See Usage notes below. |
chain |
the chain id |
augment |
If not |
indexedPattern |
the regular expression used to identify indexed model parameters. Ensure that the pattern includes groups to return the "array" name and the index. The default value isn't perfect - it allows, for example, _3a to be a valid variable name - but it sould be good enough for most purposes. |
... |
Arguments passwed to |
the corresponding tibble. See Usage notes below.
Typically, the CRM model parameters are of little intrest in their own right.
The probabiities derived from them are more relevant. If the JAGS code
derives these probabilities, they will be returned in the tibble as described
below. If not, the augment
argument provides a hook to allow them
to be derived. augment
is called immediately before the transformed
obj is returned, so it must process obj
in its transformed state.
The transformed object is in normal form, which means that usually it must be
spread()
or pivot
ed _wider
so that all model parameters are
available in a single row. This is slightly awkward, but takes little time.
See the vignette for an example.
Assuming that augment
is NULL
, the tibble returned by this
function contains the following columns:
Chain
: an integer containing the index of the corresponding
mcmc
object in the input mcmc.list
. If the input was an
mcmc
object, Chain
is 1
for all rows.
Sample
: the sample number, from the inputmcmc
object.
Parameter
: the name of the column in the input mcmc
object to
which value
relates. If the JAGS model parameter is indexed (for
example, alpha[1]
), Parameter
contains the array name (here,
alpha
) and Index
contains the array index (here, 1
).
Index
: if the corresponding Parameter
is indexed, the value of
the index. Otherwise, NA
.
Value
: The value of this Parameter
drawn in this Sample
Thin
: The value of the thinning parameter of the MCMC process used to generate
the samples
of this Chain
.
If augment
is not NULL
, the return value depends on the
actions of augment
.
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.