rhats: A Gelman-Rubin convergence diagnostic function.

Description Usage Arguments Examples

View source: R/mcmc_funcs.R

Description

This function calculates the Gelman-Rubin convergence diagnostic (Rhat) on some samples. It assumes each chain is in a separate csv file, and each file contains the samples for all parameters. For each chain, this function splits each column into two, which means "m" comes out to be twice the number of csv files. Finally, this function assumes each csv has a one-line header.

Usage

1
rhats(chain_files, burn = 0, ...)

Arguments

chain_files

vector of string paths for each file of samples

burn

the number of rows you want to discard as burn in. Defaults to 0.

...

arguments to be passed in to lapply

Examples

1
2
files <- c('/fake/path/samps1.csv', '/fake/path/samps2.csv')
rhats(files, burn = 300)

tbrown122387/mmcmc documentation built on Dec. 31, 2019, 12:34 p.m.