Trace_plot: Produce a trace plot of a variable's MCMC chain

View source: R/Utils.R

Trace_plotR Documentation

Produce a trace plot of a variable's MCMC chain

Description

Plots the chain across (non-discarded) iterations for a specified observation

Usage

Trace_plot(variable = NULL, chain = NULL)

Arguments

variable

Indicates the index of the variable

chain

MCMC chains generated by a BASSLINE MCMC function

Value

A ggplot2 object

Examples

library(BASSLINE)

# Please note: N=1000 is not enough to reach convergence.
# This is only an illustration. Run longer chains for more accurate
# estimations.

LN <- MCMC_LN(N = 1000, thin = 20, burn = 40, Time = cancer[, 1],
              Cens = cancer[, 2], X = cancer[, 3:11])
Trace_plot(1, LN)


nathansam/SMLN documentation built on May 14, 2022, 9:07 p.m.