Description Usage Arguments Value Examples
View source: R/MixClusClustering.R
This function performs the cluster analysis of mixed data sets with missing values by using the mixture model of Gaussian copulas.
1 | MixClusClustering(x, g, model="hetero", kind=NULL, nbalgo=1, burn_in=100, nbiter=1000, param)
|
x |
Input data as matrix or data-frame. The binary and the ordinal variables have to use a numeric coding as follows: 0,1,2,...,number of modalities. |
g |
Integer specifying the number of classes. |
model |
One of the following models: "hetero"= mixture of Gaussian copulas without constraint, "homo"= mixture of Gaussian copulas with equal correlation matrices, "indpt"=locally independent mixture model. |
kind |
Vector indicating the nature of the variables as follows: 1=continuous, 2=integer, 3=ordinal. If this input is not specified, the function automatically detects the nature of each variables. |
nbalgo |
Number of MCMC chains. |
burn_in |
Number of iterations for the burn-in of the Gibbs sampler. |
nbiter |
Number of iterations for the parameter estimation performed via the Gibbs sampler. |
param |
An instance of |
Return an instance of MixClusResults
class.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | ## Not run:
# Loading of a dataset simulated from a bi-component mixture model of Gaussian copulas
# (see Example 2.2 page 6)
# The first column indicates the class membership
# The last three column are used for the clustering
data(simu)
# Cluster analysis by the bi-component mixture model of Gaussian copulas
# without constrain between the correlation matrices
res.mixclus <- MixClusClustering(simu[,-1], 2)
# Confusion matrix between the estimated (row) and the true (column) partition
table(res.mixclus@data@partition, simu[,1])
# Summary of the model
summary(res.mixclus)
# Visualisation
# Update of the results (computing the conditional expectations of the latent vectors
# related to the Gaussian copulas)
res.mixclus <- MixClusUpdateForVisu(res.mixclus)
# Scatterplot of the individuals (Figure 1.(a)) described by three variables:
# one continuous (abscissa), one integer (ordiate) and one binary (symbol).
# Colors indicate the component memberships
plot(simu[,2:3], col=simu[,1], pch=16+simu[,4], xlab=expression(x^1), ylab=expression(x^2))
# Scatterplot of the individuals in the first PCA-map of the first-component of the model
MixClusVisu(res.mixclus, class = 2, figure = "scatter", xlim=c(-10,4), ylim=c(-4,4))
# Correlation circle of the first PCA-map of the first-component of the model
MixClusVisu(res.mixclus, class = 2, figure = "circle")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.