samplesPlot {basicMCMCplots} | R Documentation |
Plot MCMC traceplots and density plots
samplesPlot(samples, var = colnames(samples), ind = NULL, burnin = NULL, scale = FALSE, width = 7, height = 4, legend = TRUE, legend.location = "topright", traceplot = TRUE, densityplot = TRUE, file = NULL)
samples |
Array of MCMC samples, or a list of samples from multiple chains in which case the first chain is used |
var |
Parameter names to plot |
ind |
Indices of MCMC samples to plot |
burnin |
Number of initial MCMC samples to discard (default: 0) |
scale |
Logical, whether to normalize each posterior chain |
width |
Width of the plot |
height |
Height of the plot |
legend |
Logical, whether to include a legend of parameter names |
legend.location |
Location of legend |
traceplot |
Logical, whether to include traceplots (default: TRUE) |
densityplot |
Logaical, whether to include density plots (default: TRUE) |
file |
Optional filename to save figure as a file |
samples <- cbind(rnorm(1000), rgamma(1000, 1)) colnames(samples) <- c('alpha', 'beta') samplesPlot(samples)