create_diagnostic_plots {topolow} | R Documentation |
Create Diagnostic Plots for Multiple Chains
Description
Creates trace and density plots for multiple Adaptive Monte Carlo Sampling or optimization chains to assess convergence and mixing. Displays parameter trajectories and distributions across chains.
Usage
create_diagnostic_plots(
chain_files,
mutual_size = 2000,
output_file = "diagnostic_plots.png",
output_dir,
save_plot = FALSE,
width = 3000,
height = 3000,
res = 300
)
Arguments
chain_files |
Character vector of paths to CSV files containing chain data |
mutual_size |
Integer number of samples to use from end of each chain |
output_file |
Character path for saving plot. Required if |
output_dir |
Character. Directory for output files. Required if |
save_plot |
Logical. Whether to save plots to files. Default: FALSE |
width , height , res |
Plot dimensions and resolution for saving |
Value
A ggplot object of the combined plots.
Examples
# This example uses sample data files included with the package.
chain_files <- c(
system.file("extdata", "diag_chain1.csv", package = "topolow"),
system.file("extdata", "diag_chain2.csv", package = "topolow"),
system.file("extdata", "diag_chain3.csv", package = "topolow")
)
# Only run the example if the files are found
if (all(nzchar(chain_files))) {
# Create diagnostic plot without saving to a file
create_diagnostic_plots(chain_files, mutual_size = 2, save_plot = FALSE)
}
[Package topolow version 1.0.0 Index]