Learn R Programming

mcmcr (version 0.0.2)

rhat: R-hat

Description

Calculates the uncorrected, untransformed, univariate split R-hat (potential scale reduction factor) values.

Usage

rhat(x, ...)

# S3 method for mcarray rhat(x, by = "all", as_df = FALSE, ...)

# S3 method for mcmc rhat(x, by = "all", as_df = FALSE, ...)

# S3 method for mcmc.list rhat(x, by = "all", as_df = FALSE, ...)

# S3 method for mcmcarray rhat(x, by = "all", as_df = FALSE, ...)

# S3 method for mcmcr rhat(x, by = "all", as_df = FALSE, ...)

# S3 method for mcmcrs rhat(x, by = "all", as_df = FALSE, ...)

Arguments

x

An MCMC object.

...

Unused.

by

A string indicating whether to determine by "term", "parameter" or "all".

as_df

A flag indicating whether to return the values as a tibble versus a named list.

Value

The rhat value(s).

Methods (by class)

  • mcarray: R-hat for an mcarray object

  • mcmc: R-hat for an mcmc object

  • mcmc.list: R-hat for an mcmc.list object

  • mcmcarray: R-hat for an mcmcarray object

  • mcmcr: R-hat for an mcmcr object

  • mcmcrs: R-hat for an mcmcrs object

References

Gelman, A., and Rubin, D.B. 1992. Inference from Iterative Simulation Using Multiple Sequences. Statistical Science 7(4): 457<U+2013>472.

Examples

Run this code
# NOT RUN {
rhat(mcmcr_example)
rhat(mcmcr_example, by = "parameter")
rhat(mcmcr_example, by = "term")
rhat(mcmcr_example, by = "term", as_df = TRUE)
# }

Run the code above in your browser using DataLab