Learn R Programming

FBMS (version 1.3)

diagn_plot: Plot Convergence Diagnostics for GMJMCMC or GMJMCMC Merged Results

Description

Plots the convergence of summary statistics (e.g., median, mean) of log posteriors or marginal likelihoods over populations for a GMJMCMC or GMJMCMC merged result object, with confidence intervals.

Usage

diagn_plot(
  res,
  FUN = median,
  conf = 0.95,
  burnin = 0,
  window = 5,
  ylim = NULL,
  ...
)

Value

Returns invisible(NULL). The function is called for its side effect of producing a plot.

Arguments

res

Object of class gmjmcmc or gmjmcmc_merged containing results from a GMJMCMC run or merged runs.

FUN

Function to compute summary statistics (e.g., median, mean). Default is median.

conf

Numeric; confidence level for intervals (e.g., 0.95 for 95%). Default is 0.95.

burnin

Integer; number of initial populations to skip. Default is 0.

window

Integer; size of the sliding window for computing standard deviation. Default is 5.

ylim

Numeric vector; y-axis limits for the plot. If NULL, computed from confidence intervals.

...

Additional graphical parameters passed to plot and lines (e.g., col, lwd, lty, main, xlab, ylab).

Examples

Run this code
data(exoplanet)
result <- fbms(semimajoraxis ~ ., data = exoplanet, method = "gmjmcmc", transforms = c("sin"))
diagn_plot(result, FUN = median, conf = 0.95, main = "Convergence Plot")

Run the code above in your browser using DataLab