Learn R Programming

mmcmcBayes (version 0.1.0)

traceplot_asgn: Create Traceplots for MCMC Parameters

Description

Creates traceplots for MCMC parameters (alpha, mu, sigma2) to assess convergence. Users are responsible for setting up their preferred plot layout using par().

Usage

traceplot_asgn(mcmc_samples, param = "all", main = NULL)

Value

No return value, creates base R plots

Arguments

mcmc_samples

List containing MCMC samples for alpha, mu, and sigma2

param

Parameter to plot: "alpha", "mu", "sigma2", or "all" (default: "all")

main

Main title for the plot (optional)

Examples

Run this code
# \donttest{
# Load the datasets
data(cancer_demo)
data(normal_demo)
rst <- mmcmcBayes(cancer_demo, normal_demo, 
                 stage = 1,max_stages = 2,num_splits = 5,
                 test = "BF", priors_cancer = NULL, priors_normal = NULL,
                 bf_thresholds = list(stage1 = 10, stage2 = 10.3, stage3 = 10.3),
                 return_mcmc = TRUE)

traceplot_asgn(rst$mcmc_samples$current_stage$cancer, param = "alpha", main = "Cancer Alpha")
# }

Run the code above in your browser using DataLab