Skip to contents

This function generates and optionally saves a series of plots showing the evolution of Gelman and Rubin's shrink factor for various model parameters as the number of iterations increases. It is designed to help assess the convergence of Hmsc model by visualizing the shrink factor over iterations.

Usage

PlotGelman(
  Path_Coda = NULL,
  Alpha = TRUE,
  Beta = TRUE,
  Omega = TRUE,
  Rho = TRUE,
  NOmega = 1000,
  FromHPC = TRUE,
  PlottingAlpha = 0.25,
  EnvFile = ".env",
  ReturnPlots = FALSE
)

Arguments

Path_Coda

coda object or path to file containing the coda object.

Alpha

Logical indicating whether to plot the Gelman-Rubin statistic for the Alpha parameter. If TRUE (default), the function executes the PlotGelman_Alpha function.

Beta

Logical indicating whether to plot the Gelman-Rubin statistic for the Beta parameter. If TRUE (default), the function executes the PlotGelman_Beta function.

Omega

Logical indicating whether to plot the Gelman-Rubin statistic for the Omega parameter. If TRUE (default), the function executes the PlotGelman_Omega function.

Rho

Logical indicating whether to plot the Gelman-Rubin statistic for the Rho parameter. If TRUE (default), the function executes the PlotGelman_Rho function.

NOmega

Integer specifying the number of species to be sampled for the Omega parameter.

FromHPC

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

PlottingAlpha

A numeric value between 0 and 1 indicating the transparency level of the plot lines. Defaults to 0.25.

EnvFile

String specifying the path to the environment variables file. The default value is ".env".

ReturnPlots

String specifying the folder path where output figures should be saved.

Value

If ReturnPlots is TRUE, returns a list of ggplot objects corresponding to the generated plots. Otherwise, returns NULL.

Author

Ahmed El-Gabbas