kIdentifier {MMDai} | R Documentation |
Identify the suitable number of components k
Description
This function is used to find the suitable number of components k.
Usage
kIdentifier(data, d, TT = 1000, alpha = 0.25)
Arguments
data |
- data in matrix formation with n rows and p columns |
d |
- number of categories for each variable |
TT |
- number of iterations in Gibbs sampler, default value is 1000. T should be an even number for 'burn-in'. |
alpha |
- hyperparameter that could be regarded as the pseudo-count of the number of samples in the new component |
Value
k_est - posterior estimation of k
k_track - track of k in the iteration process
Examples
# dimension parameters
n<-200; p<-5; d<-rep(2,p);
# generate complete data
Complete<-GenerateData(n, p, d, k = 3)
# mask percentage of data at MCAR
Incomplete<-Complete
Incomplete[sample(1:n*p,0.2*n*p,replace = FALSE)]<-NA
# k identify
K<-kIdentifier(data = Incomplete, d, TT = 10)
[Package MMDai version 2.0.0 Index]