Learn R Programming

topolow (version 2.0.1)

plot.topolow_convergence: Plot Method for topolow Convergence Diagnostics

Description

Creates visualizations of convergence diagnostics from a sampling run, including parameter mean trajectories and covariance matrix stability over iterations. This helps assess whether parameter estimation has converged.

Usage

# S3 method for topolow_convergence
plot(x, param_names = NULL, ...)

Value

A grid of plots showing convergence metrics.

Arguments

x

A topolow_convergence object from check_gaussian_convergence().

param_names

Optional character vector of parameter names for plot titles. If NULL, names are taken from the input object.

...

Additional arguments (not currently used).

Details

The function generates two types of plots:

  1. Parameter mean plots: Shows how the mean value for each parameter changes over iterations. Stabilization of these plots indicates convergence.

  2. Covariance change plot: Shows the relative change in the Frobenius norm of the covariance matrix. A decreasing trend approaching zero indicates stable relationships between parameters.

See Also

check_gaussian_convergence for generating the convergence object.

Examples

Run this code
# Example with simulated data
chain_data <- data.frame(
  param1 = rnorm(1000, mean = 1.5, sd = 0.1),
  param2 = rnorm(1000, mean = -0.5, sd = 0.2)
)

# Check convergence
results <- check_gaussian_convergence(chain_data)

# Plot diagnostics
plot(results)

# With custom parameter names
plot(results, param_names = c("Parameter 1 (log)", "Parameter 2 (log)"))

Run the code above in your browser using DataLab