powered by
Perform a run of the VICatMix model on a data-frame with no variable selection imposed.
runVICatMix(data, K, alpha, maxiter = 2000, tol = 5e-08, verbose = FALSE)
A list with the following components: (maxNCat refers to the maximum number of categories for any covariate in the data)
A numeric vector listing the cluster assignments for the observations.
A numeric vector tracking the value of the ELBO in every iteration.
A numeric vector tracking the number of clusters in every iteration.
A list containing all variational model parameters and the cluster labels:
A K-length vector of Dirichlet parameters for alpha.
A K x maxNCat x P array of Dirichlet parameters for epsilon.
A N x K matrix of responsibilities for the latent variables Z.
A data frame showing how variable categories correspond to numeric factor labels in the model.
A data frame or data matrix with N rows of observations, and P columns of covariates.
Maximum number of clusters desired. Must be an integer greater than 1.
The Dirichlet prior parameter. Recommended to set this to a number < 1. Must be > 0.
The maximum number of iterations for the algorithm. Default is 2000.
A convergence parameter. Default is 5x10^-8.
Default FALSE. Set to TRUE to output ELBO values for each iteration.
# example code set.seed(20) generatedData <- generateSampleDataBin(500, 4, c(0.1, 0.2, 0.3, 0.4), 100, 0) result <- runVICatMix(generatedData$data, 10, 0.01) print(result$labels)
Run the code above in your browser using DataLab