| overfittingMFA | R Documentation | 
UCU model
Gibbs sampling for fitting a mixture model of factor analyzers.
overfittingMFA(x_data, originalX, outputDirectory, Kmax, m, thinning, burn, 
	g, h, alpha_prior, alpha_sigma, beta_sigma, 
	start_values, q, zStart, gibbs_z, lowerTriangular)
x_data | 
 normalized data  | 
originalX | 
 observed raw data (only for plotting purpose)  | 
outputDirectory | 
 Name of the output folder  | 
Kmax | 
 Number of mixture components  | 
m | 
 Number of iterations  | 
thinning | 
 Thinning of chain  | 
burn | 
 Burn-in period  | 
g | 
 Prior parameter   | 
h | 
 Prior parameter   | 
alpha_prior | 
 Parameters of the Dirichlet prior distribution of mixture weights.  | 
alpha_sigma | 
 Prior parameter   | 
beta_sigma | 
 Prior parameter   | 
start_values | 
 Optional (not used)  | 
q | 
 Number of factors.  | 
zStart | 
 Optional (not used)  | 
gibbs_z | 
 Optional  | 
lowerTriangular | 
 logical value indicating whether a lower triangular parameterization should be imposed on the matrix of factor loadings (if TRUE) or not. Default: TRUE.  | 
Set of files written in outputDirectory.
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(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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.