posterior: posterior extraction

View source: R/posterior_extraction.R

print.tbl_postR Documentation

posterior extraction

Description

MCMC chains are extracted from a Bayesian (regression) object and returned as a posterior object, which is in long format (chain, iter, parameter, value, type, order). Parameters are classified as fixef, ranef, grpef and named after a common scheme.

Usage

## S3 method for class 'tbl_post'
print(x, ...)

## S3 method for class 'tbl_post'
knit_print(x, ...)

posterior(model, shape, ...)

tbl_post(model, ...)

assert_tbl_post(x, ...)

## S3 method for class 'data.frame'
tbl_post(x, ...)

## S3 method for class 'brmsfit'
tbl_post(model, ...)

## S3 method for class 'stanreg'
tbl_post(model, ...)

Arguments

model

Bayesian model object

shape

return tbl_post in long shape or tbl_df in wide shape

thin

thinning factor

type

select parameter types to store ("fixef", "grpef", "ranef")

model_name

provides a name for the model

Value

tbl_post object with MCMC chain in long format or tbl.df in wide shape

The MCMC chains are extracted from the model and stored in a common format. Different to most internal representations, and mcmc objects from package coda, the chains are stored in a long table with the following columns:

chain iter parameter value type order (fctr) (int) (chr) (dbl) (chr) (int)

Author(s)

Martin Schmettow


schmettow/bayr documentation built on March 23, 2024, 7:49 p.m.