stan_workflow: Robust Stan Workflow Functions

Description Usage Arguments Details Value

Description

These functions are derived from from Michael Betancourt's Robust Stan Workflow, Stan case study.

Usage

1
2
3
4
5
6
7
check_div(fit)

check_treedepth(fit)

check_energy(fit, threshhold = 0.2)

partition_div(fit, pars = NULL)

Arguments

fit

A stanfit object.

threshhold

If any chain has an E-BFI below threshshold, a warning is printed.

pars

A character vector of parameters to include.

Details

check_div

Check transitions that ended with a divergence

check_energy

Check chains for low E-BFI.

check_treedepth
partition_div

Partitions parameters into divergent and non-divergent iterations.

Value

These functions are largely run interactively in order to

check_div

A list with two elements: n_div is an integer scalar with the total number of divergences, and n_iter is an integer scalar with the total number of iterations.

check_treedepth

A list with three elements:

max_depth

The maximum treedepth used in the sampler.

n_max

The number of iterations reaching the maximum depth.

n_iter

The total number of elements.

check_energy

A numeric vector with the E-BFI for each chain.

partition_div

A data frame with a row for each (sample, parameter), and columns,

.iter

Iteration number

.chain

Chain number

.div

Was this iteration a divergence?

parameter

parameter name

value

parameter value


jrnold/bayz documentation built on May 5, 2019, 5:52 p.m.