View source: R/diagnostic_plots.R
traceworstRhat | R Documentation |
Trace plots with kernel densities will be created for parameters with the largest (worst) associated values of Rhat
.
This function is primarily intended for parameters with a vector (or array) of values.
Rhat
(Gelman-Rubin Convergence Diagnostic, or Potential Scale Reduction Factor)
is calculated within 'JAGS', and is
commonly used as a measure of convergence for a given parameter node. Values close
to 1 are seen as evidence of adequate convergence. n.eff
is also calculated within 'JAGS', and may be interpreted as a crude measure of
effective sample size for a given parameter node.
traceworstRhat(x, p = NULL, n.eff = FALSE, margin = NULL, parmfrow = NULL, ...)
x |
Output object returned from |
p |
Optional vector of parameters to subset |
n.eff |
Whether to plot parameters with the smallest associated values of |
margin |
In the case of a 2+ dimensional array associated with a given parameter, this will have the effect
of plotting the worst |
parmfrow |
Optional call to |
... |
additional plotting arguments or arguments to |
NULL
Matt Tyers
Gelman, A., & Rubin, D. B. (1992). Inference from Iterative Simulation Using Multiple Sequences. Statistical Science, 7(4), 457–472. http://www.jstor.org/stable/2246093
plotRhats, check_Rhat, qq_postpred, ts_postpred, plot_postpred
## plotting everything
traceworstRhat(SS_out, parmfrow=c(3,2))
SS_out$Rhat # the associated values
traceworstRhat(SS_out, parmfrow=c(3,2), n.eff=TRUE)
SS_out$n.eff # the associated values
## in the case of a 2-D array, setting margin=2 gives the max Rhat
## associated with each column, rather than the global max
traceworstRhat(x=SS_out, p="cycle_s", margin=2, parmfrow=c(2,2))
SS_out$Rhat
traceworstRhat(x=SS_out, p="cycle_s", margin=2, parmfrow=c(2,2), n.eff=TRUE)
SS_out$n.eff
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.