# gelman: Potential scale reduction factor In ggdmc: Cognitive Models

## Description

`gelman` calls coda gelman.diag to get R hats for one or a list of subjects. It calculates at the either data or hyper level.

## Usage

 ```1 2 3 4 5 6 7 8 9``` ```gelman(x, hyper = FALSE, start = 1, end = NA, confidence = 0.95, transform = TRUE, autoburnin = FALSE, multivariate = TRUE, split = TRUE, subchain = FALSE, nsubchain = 3, digits = 2, verbose = FALSE, ...) hgelman(x, start = 1, end = NA, confidence = 0.95, transform = TRUE, autoburnin = FALSE, split = TRUE, subchain = FALSE, nsubchain = 3, digits = 2, verbose = FALSE, ...) ```

## Arguments

 `x` posterior samples `hyper` a Boolean switch, indicating posterior samples are from hierarchical modeling `start` start iteration `end` end iteration `confidence` confident inteval `transform` turn on transform `autoburnin` turn on auto burnin `multivariate` multivariate Boolean switch `split` split whether split mcmc chains; When split is TRUE, the function doubles the number of chains by spliting into 1st and 2nd halves. `subchain` whether only calculate a subset of chains `nsubchain` indicate how many chains in a subset `digits` print out how many digits `verbose` print more information `...` arguments passing to `coda` gelman.diag.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21``` ```## Not run: rhat1 <- hgelman(hsam); rhat1 rhat2 <- hgelman(hsam, end = 51); rhat2 rhat3 <- hgelman(hsam, confidence = .90); rhat3 rhat4 <- hgelman(hsam, transform = FALSE); rhat4 rhat5 <- hgelman(hsam, autoburnin = TRUE); rhat5 rhat6 <- hgelman(hsam, split = FALSE); rhat6 rhat7 <- hgelman(hsam, subchain = TRUE); rhat7 rhat8 <- hgelman(hsam, subchain = TRUE, nsubchain = 4); rhat9 <- hgelman(hsam, subchain = TRUE, nsubchain = 4, digits = 1, verbose = TRUE); hat1 <- gelman(hsam[[1]], multivariate = FALSE); hat1 hat2 <- gelman(hsam[[1]], hyper = TRUE, verbose = TRUE); hat2 hat3 <- gelman(hsam, hyper = TRUE, verbose = TRUE); hat3 hat4 <- gelman(hsam, multivariate = TRUE, verbose = FALSE); hat5 <- gelman(hsam, multivariate = FALSE, verbose = FALSE); hat6 <- gelman(hsam, multivariate = FALSE, verbose = TRUE); hat7 <- gelman(hsam, multivariate = T, verbose = TRUE); ## End(Not run) ```

ggdmc documentation built on Sept. 2, 2018, 1:03 a.m.