Skip to contents

Plots the logarithm of the Evidence Lower Bound (ELBO) and the mean change in ELBO (delta ELBO) over iterations during variational inference. This helps assess the convergence and quality of the variational fit by examining how ELBO values evolve over iterations.

Usage

plot_elbo(x, elbo_data, diagnose = TRUE)

Arguments

x

A bipod object that contains the fitted model and ELBO data.

elbo_data

A data frame or tibble containing ELBO values and their corresponding delta ELBO mean over iterations. Must include columns iter, ELBO, and delta_ELBO_mean.

diagnose

A logical value indicating whether to color the plot based on the convergence of the ELBO. If TRUE, the plot will include color coding to indicate whether the ELBO converged (green for convergence, red for lack of convergence). (default is TRUE)

Value

A ggplot2 object displaying the ELBO and delta ELBO mean traces. The plot includes a line for each variable and color coding to indicate convergence.