extract_variable_matrix: Extract matrix of a single variable

Description Usage Arguments Value Examples

View source: R/extract_variable_matrix.R

Description

Extract an iterations x chains matrix of draws of a single variable. This is primarily used for convergence diagnostic functions such as rhat().

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
extract_variable_matrix(x, variable, ...)

## Default S3 method:
extract_variable_matrix(x, variable, ...)

## S3 method for class 'draws'
extract_variable_matrix(x, variable, ...)

## S3 method for class 'draws_rvars'
extract_variable_matrix(x, variable, ...)

Arguments

x

(draws) A draws object or another R object for which the method is defined.

variable

(string) The name of the variable to extract.

...

Arguments passed to individual methods (if applicable).

Value

A matrix with dimension iterations x chains.

Examples

1
2
3
4
x <- example_draws()
mu <- extract_variable_matrix(x, variable = "mu")
dim(mu)
rhat(mu)

posterior documentation built on Sept. 9, 2021, 5:07 p.m.