Skip to contents

This function generates and plots convergence traceplots for the rho parameter of an Hmsc model. It visualizes the trace and density of the rho parameter across different chains, providing insights into the convergence and distribution of the parameter estimates.

Usage

PlotRho(Post, Model, Title, Cols = NULL, MarginType = "histogram")

Arguments

Post

A coda object containing MCMC samples of the rho parameter or a character string specifying the path to such an object.

Model

A fitted Hmsc model object or a character string specifying the path to such an object.

Title

A character string specifying the title of the plot.

Cols

Character vector for chain colours (optional). Default: NULL.

MarginType

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

Value

A ggplot object representing the traceplot of the rho parameter, including annotations for the Gelman-Rubin diagnostic, effective sample size, and credible intervals.

Author

Ahmed El-Gabbas