Overview

Pacakge overview and global options

posterior-package

Tools for working with posterior (and prior) distributions

Draws objects and formats

Createdraws objects and convert between supported formats

as_draws() is_draws()

Transform to draws objects

as_draws_array() draws_array() is_draws_array()

The draws_array format

as_draws_df() draws_df() is_draws_df()

The draws_df format

as_draws_list() draws_list() is_draws_list()

The draws_list format

as_draws_matrix() draws_matrix() is_draws_matrix()

The draws_matrix format

as_draws_rvars() draws_rvars() is_draws_rvars()

The draws_rvars format

print(<draws_array>)

Print draws_array objects

print(<draws_df>)

Print draws_df objects

print(<draws_list>)

Print draws_list objects

print(<draws_matrix>)

Print draws_matrix objects

print(<draws_rvars>)

Print draws_rvars objects

print(<rvar>) format(<rvar>) str(<rvar>)

Print or format a random variable

variables() `variables<-`() iteration_ids() chain_ids() draw_ids() nvariables() niterations() nchains() ndraws()

Index draws objects

example_draws()

Example draws objects

Working with draws objects

Functions for modifying draws objects and extracting their contents

bind_draws()

Bind draws objects together

extract_variable()

Extract draws of a single variable

extract_variable_matrix()

Extract matrix of a single variable

merge_chains()

Merge chains of draws objects

mutate_variables()

Mutate variables in draws objects

order_draws()

Order draws objects

split_chains()

Split Chains

subset_draws() subset(<draws>)

Subset draws objects

rename_variables()

Rename variables in draws objects

repair_draws()

Repair indices of draws objects

resample_draws()

Resample draws objects

thin_draws()

Thin draws objects

weight_draws()

Weight draws objects

weights(<draws>)

Extract Weights from Draws Objects

Summarizing and diagnosing draws objects

Compute summary statistics and convergence diagnostics

summarise_draws() summarize_draws() summary(<draws>) summary(<rvar>) default_summary_measures() default_convergence_measures() default_mcse_measures()

Summaries of draws objects

diagnostics

List of available convergence diagnostics

ess_basic()

Basic version of the effective sample size

ess_bulk()

Bulk effective sample size (bulk-ESS)

ess_mean()

Effective sample size for the mean

ess_quantile() ess_median() ess_mean(<default>)

Effective sample sizes for quantiles

ess_sd()

Effective sample size for the standard deviation

ess_tail()

Tail effective sample size (tail-ESS)

rhat()

Rhat convergence diagnostic

rhat_basic()

Basic version of the Rhat convergence diagnostic

mcse_mean()

Monte Carlo standard error for the mean

mcse_quantile() mcse_median()

Monte Carlo standard error for quantiles

mcse_sd()

Monte Carlo standard error for the standard deviation

quantile2()

Compute Quantiles

rstar()

Calculate R* convergence diagnostic

Functionality specific to the rvar datatype

The draws_rvar format (a structured list of rvar objects) has the same methods (e.g. bind_draws()) as the other draws formats. For individual rvar objects themselves, however, posterior provides additional functionality.

chol(<rvar>)

Cholesky decomposition of random matrix

density(<rvar>) cdf(<rvar>) quantile(<rvar>)

Density, CDF, and quantile functions of random variables

`%**%`

Matrix multiplication of random variables

E() mean(<rvar>) Pr() median(<rvar>) min(<rvar>) max(<rvar>) sum(<rvar>) prod(<rvar>) all(<rvar>) any(<rvar>) Summary(<rvar>) variance(<rvar>) var() sd() mad() range(<rvar>) is.finite(<rvar>) is.infinite(<rvar>) is.nan(<rvar>) is.na(<rvar>)

Summaries of random variables within array elements, over draws

rvar_mean() rvar_median() rvar_sum() rvar_prod() rvar_min() rvar_max() rvar_sd() rvar_var() rvar_mad() rvar_range() rvar_quantile() rvar_all() rvar_any()

Summaries of random variables over array elements, within draws

rvar()

Random variables of arbitrary dimension

rvar_apply()

Random variable resulting from a function applied over margins of an array or random variable

rvar_is_finite() rvar_is_infinite() rvar_is_nan() rvar_is_na()

Special value predicates for random variables

rvar_rng()

Create random variables from existing random number generators

is_rvar()

Is x a random variable?

as_rvar()

Coerce to a random variable

rdo()

Execute expressions of random variables

rfun()

Create functions of random variables

draws_of() `draws_of<-`()

Get/set array of draws underlying a random variable

vec_ptype2(<rvar>) vec_ptype2.rvar(<default>) vec_cast(<rvar>) vec_cast.rvar(<default>) vec_ptype2.rvar(<rvar>) vec_cast.rvar(<rvar>) vec_ptype2.double(<rvar>) vec_ptype2.rvar(<double>) vec_cast.rvar(<double>) vec_ptype2.integer(<rvar>) vec_ptype2.rvar(<integer>) vec_cast.rvar(<integer>) vec_ptype2.logical(<rvar>) vec_ptype2.rvar(<logical>) vec_cast.rvar(<logical>)

rvar vctrs compatibility