Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/checkIsConverged.r
Run various diagnostic procedures in the coda
package
to check convergence of a set of mcmc chains.
1 | checkIsConverged(obj, criterion = 1.1, quiet = FALSE)
|
obj |
An mcmc.list object from the |
quiet |
Whether to print any output on screen. |
This routine runs the Gelman and Rubin (1992) diagnostic for
a set of MCMC chains by calling gelman.diag
in the coda
package.
A list with the following components
converged: If the uppper limits of the 'potential scale
reduction factors' associated with all parameters are less than
criterion
, the chain is declared converged and this is TRUE.
Otherwise, this component of the returns is FALSE.
Rhats: the 'potential scale reduction factors' or Rhats associated with all parameters.
Trent McDonald
Gelman, A and Rubin, DB (1992) Inference from iterative simulation using multiple sequences, Statistical Science, 7, 457-511.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
jags = jags.model(file="someJAGSFile.txt",
data=someJAGS.data, inits=someJAGS.inits,
n.chains=3,n.adapt=100)
update(jags, n.iter=1000)
out = coda.samples(jags,
variable.names=c("someParameter"),
n.iter=1000,
thin=2)
conf <- chechIsConverged(out)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.