Description Usage Arguments Value Author(s) Examples
View source: R/tidy-mcmc-list.R
tidy.mcmc.list
is a function that behaves like those from broom
. It takes
an mcmc.list object from coda.samples
and return a data frame that
summarises each parameters with its mean and quantiles and returns the output
as a data.table object. This can be called as tidy
. Currently summarises
over all chains.
1 2 |
x |
object of class "mcmc.list", as you would find with fitting a model
using |
conf_level |
level of the credible interval to be calculated. Can be multiple values. |
chain |
whether or not to summarise each parameter for each chain |
colnames |
which parameters we want from |
... |
extra arguments |
a data.table containing parameter summaries
Sam Clifford, sj.clifford@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 | library(coda)
data(line)
tidy(line)
# Optionally ask for a subset of parameters with a vector of `colnames`,
# and summarise for each chain:
tidy(line,
chain = TRUE,
colnames=c("alpha"))
# can provide two levels of confidence:
tidy(line, conf_level = c(0.95, 0.50))
tidy(line, conf_level = c(0.95))
tidy(line, conf_level = c(0.89, 0.25))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.