| ggChains {CNPBayes} | R Documentation |
The ggChains method provides a convenient wrapper for plotting the chains of all parameters in the various mixture model implementations. In addition to the estimated number of independent MCMC draws (effective sample size) and Gelman-Rubin convergence diagnostics implemented in gibbs, visualization of the chains is helpful for assessing convergence.
ggChains(model) ggMixture(model, bins = 100) ## S4 method for signature 'MultiBatchCopyNumber' ggMixture(model, bins = 100) ## S4 method for signature 'MultiBatchCopyNumberPooled' ggMixture(model, bins = 100) ## S4 method for signature 'MultiBatchModel' ggMixture(model, bins = 100) ## S4 method for signature 'MultiBatch' ggMixture(model, bins = 100) ## S4 method for signature 'MultiBatchPooled' ggMixture(model, bins = 100) ## S4 method for signature 'MultiBatchModel' ggChains(model) ## S4 method for signature 'MultiBatchPooled' ggChains(model)
model |
A SB, MB, SBP, or MBP model |
bins |
a length-one numeric vector indicating the number of bins – passed to |
The ggMixture method overlays the density of the posterior predictive distribution of the Gaussian mixture on the empirical data. ggMixture assumes that you have already run the Gibbs sampler either by the gibbs function or by the posteriorSimulation function.
A gg object
sb <- SingleBatchModelExample iter(sb) <- 1000 burnin(sb) <- 100 sb <- posteriorSimulation(sb) fig.chains <- ggChains(sb) ## component-specific chains fig.chains[["comp"]] ## single-parameter chains and log-likelihood fig.chains[["single"]] ## plot the mixture fig.mix <- ggMixture(sb) data(MultiBatchModelExample) fig <- ggMixture(MultiBatchModelExample)