4. The R implementation of the CoClust algorithm

The copula-based clustering algorithm procedure is implemented in the R package CoClust [26]. It must be installed in the usual way, that is:

```
R> install.packages("CoClust")
```
and then it must be loaded through the usual code:

```
R> library("CoClust")
```
The code of the CoClust package is entirely written in R, to enable using an easily accessible open source system and the input/output facilities.

interest and selecting the one that fits best a posteriori using one of the criteria introduced in

method.ma = c("empirical", "pseudo"), method.c = c("ml", "mpl",

CoClust: An R Package for Copula-Based Cluster Analysis

http://dx.doi.org/10.5772/intechopen.74865

103

dfree = NULL, writeout = 5, penalty = c("BICk", "AICk", "LL"), …)

where m is the entry data matrix and the writeout argument allows monitoring the allocation process, since it informs on each new allocated observation. Further details on the input

The main output of the function CoClust is an object of S4 class "CoClust" which is a list with

2. Index Matrix: a n:obs � ð Þ K þ 1 matrix where n.obs is the number of observations put into each cluster; the matrix contains the row indexes of the observations of the data matrix m

3. Data Clusters: the data matrix of the final clustering; each column contains the observa-

9. Index.dimset: a list that, for each k in dimset, contains the index matrix of the initial set of nk observations used to select the number of clusters, together with the associated maxi-

This section shows how to use the CoClust package on data simulated from different DGPs. In the first example, the data are drawn from a joint density function with different margins,

CoClust(m, dimset = 2:5, noc = 4, copula = "frank", fun = median,

1. Number of Clusters: the number K of selected and identified clusters;

(Eq. (8)) and in the last column the log-likelihood of the copula fit;

b. Param: the estimated dependence parameter between/among clusters;

d. P.val: the p-value associated to the null hypothesis H<sup>0</sup> : θ ¼ 0;

a. Model: the copula model used for the clustering;

6. Est.Method: the estimation method used for the copula fit;

7. Opt.Method: the optimization method used for the copula fit;

8. LLC: the value of the log-likelihood criterion for each k in dimset;

c. Std.Err: the standard error of Param;

5. LogLik: the maximized log-likelihood copula fit;

mized log-likelihood copula fit.

4.3. Simulated examples

The typical use of the function CoClust is as follows:

"irho", "itau"),

arguments are given in the package help files.

the following elements:

tions allocated in a cluster; 4. Dependence: a list containing:

Section 3.2.
