powered by
Plot MCMC traceplots and density plots
samplesPlot( samples, var = colnames(samples), ind = NULL, burnin = NULL, scale = FALSE, line = NULL, width = 7, height = 4, legend = TRUE, legend.location = "topright", traceplot = TRUE, densityplot = TRUE, file = NULL )
Array of MCMC samples, or a list of samples from multiple chains in which case the first chain is used
Parameter names to plot
Indices of MCMC samples to plot
Number of initial MCMC samples to discard (default: 0)
Logical, whether to normalize each posterior chain
Numeric vector of true parameter values for adding lines to plots
Width of the plot
Height of the plot
Logical, whether to include a legend of parameter names
Location of legend
Logical, whether to include traceplots (default: TRUE)
Logaical, whether to include density plots (default: TRUE)
Optional filename to save figure as a file
# NOT RUN { samples <- cbind(rnorm(1000), rgamma(1000, 1)) colnames(samples) <- c('alpha', 'beta') samplesPlot(samples) # }
Run the code above in your browser using DataLab