Skip to contents

This function generates and saves a series of diagnostic plots to assess the convergence of Hmsc models across multiple modelling alternatives. It checks model convergence using trace plots and Gelman-Rubin diagnostics for key model parameters.

Usage

Convergence_Plot_All(
  ModelDir = NULL,
  maxOmega = 1000,
  NCores = NULL,
  FromHPC = TRUE,
  MarginType = "histogram"
)

Arguments

ModelDir

String. Path to the root directory of the fitted models without the trailing slash. The convergence outputs will be saved to the Model_Convergence_All subfolder.

maxOmega

Integer. Maximum number of species interactions to sample for convergence diagnostics.

NCores

Integer. Number of cores to use for parallel processing.

FromHPC

Logical. Indicates whether the function is being run on an HPC environment, affecting file path handling. Default: TRUE.

MarginType

A string specifying the type of marginal plot to add to the main plot. Must be either "histogram" or "density". Default: "histogram".

Value

The function does not return anything but saves a series of diagnostic plots in the specified path.

Author

Ahmed El-Gabbas