overfittingMFA_CUC: Basic MCMC sampler for the 'CUC' model

Description Usage Arguments Value Author(s) Examples

View source: R/fabMix.R

Description

Gibbs sampling for fitting a CUC mixture model of factor analyzers.

Usage

1
2
3
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)

Arguments

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 g. Default value: g = 2.

h

Prior parameter h. Default value: h = 1.

alpha_prior

Parameters of the Dirichlet prior distribution of mixture weights.

alpha_sigma

Prior parameter α. Default value: α = 2.

beta_sigma

Prior parameter β. Default value: β = 1.

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.

Value

Set of files written in outputDirectory.

Author(s)

Panagiotis Papastamoulis

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
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)

fabMix documentation built on Feb. 20, 2020, 1:09 a.m.