plot_trace: make a trace plot of a single fitted variable

View source: R/plotting.R

plot_traceR Documentation

make a trace plot of a single fitted variable

Description

make a trace plot of a single fitted variable

Usage

plot_trace(
  chain,
  true_value,
  start_value,
  var_name,
  y_lab,
  ylim,
  zoom,
  n_samples = 0,
  real_data
)

Arguments

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.

Value

ggplot object


ada-w-yan/deltaomicron1 documentation built on June 24, 2022, 5:41 a.m.