View source: R/variational_fit.R
variational_fit | R Documentation |
Variational fit for a semi-parametric Dirichelt mixture of Binomial
distributions. The fit convergency can be monitored through the ELBO,
can be run either sequentially (single core) or in parallel. You need
to provide an upper bound on the number of clusters that you want to
obtain, through parameters K
. You can explicit the Dirichlet
prior for the concentration of the mixture (alpha_0
), as well as
the hyperparmeters of the Beta priors for each mixture component.
variational_fit( x, y, data = NULL, K = 10, alpha_0 = 1e-06, a_0 = 1, b_0 = 1, max_iter = 5000, epsilon_conv = 1e-10, samples = 10, q_init = "prior", trace = FALSE, description = "My VIBER model" )
x |
A matrix where each column is a dimension of the multivariate Binomial,
and each row is an input point. Values of this matrix represent the number of
successes of independent Bernoulli trials. This matrix and |
y |
A matrix where each column is a dimension of the multivariate Binomial,
and each row is an input point. Values of this matrix represent the number of
attempts of independent Bernoulli trials. This matrix and |
data |
Extra data.frame ( |
K |
The maximum number of clusters returned, it should be lower than the
number of rows of |
alpha_0 |
The concentration parameter of the Dirichlet mixture. The default
is a stringent fit with |
a_0 |
Prior Beta hyperparameter. If this values is a scalar than all the
mixture components have the same prior. The default is scalar |
b_0 |
Prior Beta hyperparameter. If this values is a scalar than all the
mixture components have the same prior. The default is scalar |
max_iter |
Maximum number of fit iterations. The fit is interrupted when
this number of iterations is performed. Default |
epsilon_conv |
Epsilon to measure convergence (ELBO absolute difference). |
samples |
Number of fits computed by the algorithm. Only the best fit is returned. This value must be greater or equal than 1. |
q_init |
Initialization of the q-distribution to compute the approximation
of the posterior distributions. This can be set in three different waysL
equal to the prior ( |
trace |
If true the trace computed during the fit is returned (this allows
to check fits a posterirori, make animations etc.). Default is |
An object of class vb_bmm
which contains S3 methods to extract
the fit, plots the results, compute summary statistics etc.
data(mvbmm_example) f = variational_fit(mvbmm_example$successes, mvbmm_example$trials) print(f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.