plot_trace | R Documentation |
Takes the MCMC object returned from a split and produces trace_plots for the listed parameters. It shows a separate line on the plot for each chain and also shows the value of Rhat
plot_trace(
title = " ",
results = NULL,
parms_to_plot = NULL,
nrow = 2,
ncol = 2
)
title |
A character string used for a title on reports and graphs |
results |
The MCMC object containing the results from the call to JAGS |
parms_to_plot |
A character vector of names of parameters to plot. These must match exactly to the parameter names used in the simulation. |
ncol , nrow |
How many plots to put on a page (number of rows and columns) |
List of ggplot2 objects using facet_wrap_paginate (...., page=...) with each element of the list corresponding to one page of the plot.
Bonner, S.J. sbonner6@uwo.ca and Schwarz, C. J. cschwarz.stat.sfu.ca@gmail.com.
## Not run:
# Create trace plots of the logitP parameters
#
# Trace plots of logitP
varnames <- names(results$sims.array[1,1,]) # extract the names of the variables
trace.plot <- plot_trace(title=title,
results=results,
parms_to_plot=varnames[grep("^logitP", varnames)])
if(save.output.to.files){
pdf(file=paste(prefix,"-trace-logitP.pdf",sep=""))
plyr::l_ply(trace.plot, function(x){plot(x)})
dev.off()
}
## End(Not run) # end of dontrun
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.