pull_post {jagshelper} | R Documentation |
Subset from posterior data.frame
Description
Extracts a subset vector or data.frame
from a data.frame
consisting of more columns,
such that column names match a name given in the p=
argument. This may be useful
in creating smaller objects consisting of MCMC samples.
Usage
pull_post(x, p = NULL, exact = FALSE)
Arguments
x |
Posterior |
p |
String to begin posterior names. If |
exact |
Whether name must be an exact match ( |
Value
A data.frame
with a column associated with each (subsetted) parameter and a row
associated with each MCMC iteration.
Author(s)
Matt Tyers
See Also
Examples
out_df <- jags_df(asdf_jags_out)
b <- pull_post(out_df, p="b")
str(b)
a <- pull_post(out_df, p=c("a","sig_a"))
str(a)
sigs <- pull_post(out_df, p="sig")
str(sigs)
justsig <- pull_post(out_df, p="sig", exact=TRUE)
str(justsig)
[Package jagshelper version 0.3.1 Index]