estimate_atoms_weights_vi {SANvi} | R Documentation |
Estimate the Posterior Atoms and Weights of the Discrete Mixing Distributions
Description
This function estimates the posterior atoms and weights characterizing the discrete mixing distributions using the variational estimates obtained from one of the model implemented in SANvi.
Usage
estimate_atoms_weights_vi(output)
## S3 method for class 'vi_atoms_weights'
plot(x, DC_num = NULL, lim = 2, ...)
## S3 method for class 'vi_atoms_weights'
print(x, thr = 0.01, ...)
Arguments
output |
an object of class |
x |
an object of class |
DC_num |
an integer or a vector of integers indicating which distributional clusters to plot. |
lim |
optional value for |
... |
ignored. |
thr |
argument for the |
Value
an object of class vi_atoms_weights
, which is matrix comprising posterior means,
variances, and a columns for each estimated DC containing the posterior weights.
See Also
variational_CAM
, variational_fiSAN
,
variational_fSAN
, extract_best
.
Examples
# 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)