View source: R/visualization.R
plot.topolow_convergence | R Documentation |
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.
## S3 method for class 'topolow_convergence'
plot(x, param_names = NULL, ...)
x |
A |
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). |
The function generates two types of plots:
Parameter mean plots: Shows how the mean value for each parameter changes over iterations. Stabilization of these plots indicates convergence.
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.
A grid of plots showing convergence metrics.
check_gaussian_convergence
for generating the convergence object.
# 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)"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.