plot.SANmcmc {SANple}R Documentation

Plotting MCMC output

Description

Plot method for objects of class SANmcmc. The function displays two graphs, meant to analyze the estimated distributional and observational clusters.

Usage

## S3 method for class 'SANmcmc'
plot(
  x,
  type = c("boxplot", "ecdf", "scatter"),
  estimated_clusters = NULL,
  burnin = NULL,
  palette_brewed = FALSE,
  ncores = 0,
  ...
)

Arguments

x

object of class SANmcmc (the result of a call to sample_fiSAN, sample_fiSAN_sparsemix, sample_fSAN, sample_fSAN_sparsemix, or sample_CAM).

type

what type of plot should be drawn (only for the left-side plot). Possible types are "boxplot", "ecdf", and "scatter".

estimated_clusters

the output of a call to estimate_clusters (optional). It can be used to speed up the function if the partition has already been computed. If estimated_clusters = NULL, the displayed partition is computed using estimate_clusters.

burnin

the length of the burn-in to be discarded (default is 2/3 of the iterations).

palette_brewed

(logical) the color palette to be used. Default is R base colors (palette_brewed = FALSE).

ncores

if the partition is computed, the number of CPU cores to use to estimate the clusters, i.e., the number of simultaneous runs at any given time. A value of zero indicates to use all cores on the system.

...

additional graphical parameters to be passed when type = "scatter" is used.

Value

The function plots a summary of the fitted model.

See Also

print.SANmcmc, estimate_clusters

Examples

set.seed(123)
y <- c(rnorm(40,0,0.3), rnorm(20,5,0.3))
g <- c(rep(1,30), rep(2, 30))
out <- sample_fiSAN(nrep = 500, y = y, group = g, 
                    nclus_start = 2,
                    maxK = 20, maxL = 20,
                    beta = 1)
plot(out, type = "ecdf", palette_brewed = TRUE)


[Package SANple version 0.1.0 Index]