plot.SANvi: Visual Check of the Convergence of the VI Output
Description
Plot method for objects of class SANvi.
The function displays two graphs. The left plot shows the progression of all the ELBO values as a function of the iterations.
The right plots shows the ELBO increments between successive iterations of the best run on a log scale (note: increments should always be positive).
Usage
# S3 method for SANvi
plot(x, ...)
Value
The function plots the path followed by the ELBO and its subsequent differences.
Arguments
x
Object of class SANvi (usually, the result of a call to fit_CAM, fit_fiSAN, or fit_fSAN, used with the est_method = "VI" argument).
set.seed(123)
y <- c(rnorm(200,0,0.3), rnorm(100,5,0.3))
g <- c(rep(1,150), rep(2, 150))
out <- fit_fSAN(y = y, group = g, "VI", vi_param = list(n_runs = 2))
plot(out)