CUC
modelGibbs sampling for fitting a CUC mixture model of factor analyzers.
overfittingMFA_CUC(x_data, originalX, outputDirectory, Kmax, m, thinning, burn,
g, h, alpha_prior, alpha_sigma, beta_sigma,
start_values, q, zStart, gibbs_z, lowerTriangular)
Set of files written in outputDirectory
.
normalized data
observed raw data (only for plotting purpose)
Name of the output folder
Number of mixture components
Number of iterations
Thinning of chain
Burn-in period
Prior parameter
Prior parameter
Parameters of the Dirichlet prior distribution of mixture weights.
Prior parameter
Prior parameter
Optional (not used)
Number of factors.
Optional (not used)
Optional
logical value indicating whether a lower triangular parameterization should be imposed on the matrix of factor loadings (if TRUE) or not. Default: TRUE.
Panagiotis Papastamoulis
library('fabMix')
n = 8 # sample size
p = 5 # number of variables
q = 2 # number of factors
K = 2 # true number of clusters
sINV_diag = 1/((1:p)) # diagonal of inverse variance of errors
set.seed(100)
syntheticDataset <- simData(sameLambda=TRUE,K.true = K, n = n, q = q, p = p,
sINV_values = sINV_diag)
colnames(syntheticDataset$data) <- paste0("x_",1:p)
Kmax <- 4 # number of components for the overfitted mixture model
set.seed(1)
overfittingMFA_CUC(x_data = syntheticDataset$data,
originalX = syntheticDataset$data, outputDirectory = 'outDir',
Kmax = Kmax, m = 5, burn = 1,
g = 0.5, h = 0.5, alpha_prior = rep(1, Kmax),
alpha_sigma = 0.5, beta_sigma = 0.5,
start_values = FALSE, q = 2, gibbs_z = 1)
list.files('outDir')
unlink('outDir', recursive = TRUE)
Run the code above in your browser using DataLab