Learn R Programming

postpack (version 0.5.4)

Utilities for Processing Posterior Samples Stored in 'mcmc.lists'

Description

The aim of 'postpack' is to provide the infrastructure for a standardized workflow for 'mcmc.list' objects. These objects can be used to store output from models fitted with Bayesian inference using 'JAGS', 'WinBUGS', 'OpenBUGS', 'NIMBLE', 'Stan', or even custom MCMC algorithms. Although the 'coda' R package provides some methods for these objects, it is somewhat limited in easily performing post-processing tasks for specific nodes. Models are ever increasing in their complexity and the number of tracked nodes, and oftentimes a user may wish to summarize/diagnose sampling behavior for only a small subset of nodes at a time for a particular question or figure. Thus, many 'postpack' functions support performing tasks on a subset of nodes, where the subset is specified with regular expressions. The functions in 'postpack' streamline the extraction, summarization, and diagnostics of specific monitored nodes after model fitting. Further, because there is rarely only ever one model under consideration, 'postpack' scales efficiently to perform the same tasks on output from multiple models simultaneously, facilitating rapid assessment of model sensitivity to changes in assumptions.

Copy Link

Version

Install

install.packages('postpack')

Monthly Downloads

225

Version

0.5.4

License

MIT + file LICENSE

Maintainer

Ben Staton

Last Published

December 21st, 2022

Functions in postpack (0.5.4)

diag_plots

Create MCMC diagnostic plots for nodes of interest
post_summ

Obtain posterior summaries and diagnostics of specific nodes
ins_regex_bracket

Insert escapes on regex brackets
ins_regex_lock

Insert the symbols to lock in a string for matching
drop_index

Extract the base node name of a parameter
list_out

List vector elements in a nice format
match_params

Find matching node names
get_params

Obtain the names of all nodes
rm_regex_lock

Remove the symbols that lock in a string for matching
post_convert

Convert MCMC samples to mcmc.list format
post_dim

Obtain MCMC dimensions from an mcmc.list
trace_plot

Create a trace plot for a single desired node
post_remove

Remove nodes from mcmc.list
id_mat

Extract chain and iteration IDs for each sample
mytitle

Add a title between two figures
post_thin

Perform post-MCMC thinning
post_subset

Extract samples from specific nodes
postpack

Utilities for Processing Posterior Samples Stored in mcmc.lists
post_bind

Combine two objects containing posterior samples
vcov_decomp

Decompose the posterior of a variance-covariance node
write_model

Export BUGS/JAGS model from function to file
rm_regex_bracket

Remove escapes on regex brackets
array_format

Convert a vector to the array structure used in model
cjs_no_rho

Example mcmc.list 2
density_plot

Create a density plot for a single desired node
cjs

Example mcmc.list 1