plot_trace | R Documentation |
make a trace plot of a single fitted variable
plot_trace( chain, true_value, start_value, var_name, y_lab, ylim, zoom, n_samples = 0, real_data )
chain |
data table containing iterations of MCMC chain after discarding burn-in |
true_value |
numeric vector of length 1. The true parameter value (if unknown because we're using real data, set this to any value) |
start_value |
Parameter value at start of MCMC chain (before discarding burn-in) |
var_name |
name of parameter to plot in colnames(chain) |
y_lab |
parameter name to display on plot |
ylim |
if zoom = FALSE, numeric vector of length 2 giving lower and upper limits of y axis. If either of these is NA, the range of the parameter values in the chain + the start value is used. if zoom = TRUE, this parameter is not used. |
zoom |
logical vector of length 1. if TRUE, the y-axis limits are the range of the parameter values in the chain (the start value is disregarded). if FALSE, the limits are as descibed in ylim. |
n_samples |
numeric vector of length 1. number of samples to plot, taken at evenly spaced intervals along the chain. if 0, plot all samples. |
ggplot object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.