checkConvergence {ptycho} | R Documentation |
Compute Differences Between MCMC Chains
Description
Compute the differences between the chains in a ptycho
object
of the means of and the indicator variables.
Usage
checkConvergence(obj, doLastIterOnly=TRUE)
Arguments
obj |
A |
doLastIterOnly |
Logical specifying whether to compute differences only for the last MCMC iteration in the input object or for all iterations |
Details
For and each indicator variable in the input
ptycho
object, compute the difference between the maximum and the minimum mean for
each chain. If doLastIterOnly
is TRUE
, then the differences are
only computed for the last iteration in each chain; otherwise, the differences
are computed at each iteration in the input object.
Value
A data frame with the following columns:
iter
MCMC iteration number
type
Factor specifying the type of the variable; one of “tau”, “var” for variant indicator variable, or “grp” for second-level indicator variable
index
Number specifying the pertinent column in the design matrix (for
type
equal to “var” or fortype
equal to “grp” when Across Traits prior was used) or the variant group index (fortype
equal to “grp” when Across Sites prior was used); equal to 1 fortype
equal to “tau”y
Factor specifying the name of the response; empty for
type
equal to “tau” or fortype
equal to “grp” when Across Traits prior was usedrange
Difference between maximum and minimum across chains
Author(s)
Laurel Stell and Chiara Sabatti
Maintainer: Laurel Stell <lstell@stanford.edu>
See Also
ptycho
; also ptychoOut
for example below
Examples
data(ptychoOut)
cvg <- checkConvergence(ptychoOut, doLastIterOnly=FALSE)
reshape2::dcast(cvg, ... ~ iter, value.var="range")