# Generate example data
set.seed(1232)
y <- c(rnorm(100),rnorm(100,5))
g <- rep(1:2,rep(100,2))
# Fitting fiSAN via variational inference
est <- variational_fiSAN(y,g,verbose = FALSE)
# Estimate posterior atoms and weights
estimate_atoms_weights_vi(est)
Run the code above in your browser using DataLab