Learn R Programming

MixGHD (version 2.3.7)

MGHD: Mixture of generalized hyperbolic distributions (MGHD).

Description

Carries out model-based clustering and classification using the mixture of generalized hyperbolic distributions.

Usage

MGHD(data=NULL,gpar0=NULL,G=2,max.iter=100,label=NULL,eps=1e-2,
method="kmeans",scale=TRUE,nr=10, modelSel="AIC")

Arguments

data

A n x p matrix or data frame such that rows correspond to observations and columns correspond to variables.

gpar0

(optional) A list containing the initial parameters of the mixture model. See the 'Details' section.

G

The range of values for the number of clusters.

max.iter

(optional) A numerical parameter giving the maximum number of iterations each EM algorithm is allowed to use.

label

( optional) A n dimensional vector, if label[i]=k then observation i belongs to group k, If label[i]=0 then observation i has no known group, if NULL then the data has no known groups.

eps

(optional) A number specifying the epsilon value for the convergence criteria used in the EM algorithms. For each algorithm, the criterion is based on the difference between the log-likelihood at an iteration and an asymptotic estimate of the log-likelihood at that iteration. This asymptotic estimate is based on the Aitken acceleration.

method

( optional) A string indicating the initialization criterion, if not specified kmeans clustering is used. Alternative methods are: hierarchical "hierarchical", random "random", and model based "modelBased" clustering

scale

( optional) A logical value indicating whether or not the data should be scaled, true by default.

nr

( optional) A number indicating the number of starting value when random is used, 10 by default.

modelSel

( optional) A string indicating the model selection criterion, if not specified AIC is used. Alternative methods are: BIC,ICL, and AIC3

Value

A S4 object of class MixGHD with slots:

index

Value of the index used for model selection (AIC or ICL or BIC or AIC3) for each G,the index used is specified by the user, if not specified AIC is used.

BIC

Bayesian information criterion.

ICL

Integrated completed likelihood..

AIC

Akaike information criterion.

AIC3

Akaike information criterion 3.

gpar

A list of the model parameters.

loglik

The log-likelihood values.

map

A vector of integers indicating the maximum a posteriori classifications for the best model.

z

A matrix giving the raw values upon which map is based.

%% ~Describe the value returned %% If it is a LIST, use %% \item{comp1 }{Description of 'comp1'} %% \item{comp2 }{Description of 'comp2'} %% ...

Details

The arguments gpar0, if specified, is a list structure containing at least one p dimensional vector mu, and alpha, a pxp matrix sigma, and a 2 dimensional vector containing omega and lambda.

References

R.P. Browne, and P.D. McNicholas (2015). A Mixture of Generalized Hyperbolic Distributions. Canadian Journal of Statistics, 43.2 176-198\ C. Tortora, R. P. Browne, A. ElSherbiny, B. C. Franczak, and P. D. McNicholas (2021). Model-Based Clustering, Classification, and Discriminant Analysis using the Generalized Hyperbolic Distribution: MixGHD R package, Journal of Statistical Software 98(3) 1--24, <doi:10.18637/jss.v098.i03>.

Examples

Run this code
# NOT RUN {
##loading crabs data
data(crabs)

##model estimation
model=MGHD(data=crabs[,4:8],  G=2   )

#result
plot(model)
table(model@map, crabs[,2])

## Classification
##loading bankruptcy data
data(bankruptcy)
#70% belong to the training set
 label=bankruptcy[,1]
#for a Classification porpuse the label cannot be 0
 label[1:33]=2
 a=round(runif(20)*65+1)
 label[a]=0
 
 
##model estimation
model=MGHD(data=bankruptcy[,2:3],  G=2, label=label )

#result
table(model@map,bankruptcy[,1])
plot(model)
# }

Run the code above in your browser using DataLab