DA: Discriminant analysis using the mixture of generalized...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/DA.R

Description

Carries out model-based discriminant analysis using 5 different models: the mixture of multiple scaled generalized hyperbolic distributions (MGHD), the mixture of generalized hyperbolic factor analyzers (MGHFA), the mixture of multiple scaled generalized hyperbolic distributions (MSGHD),the mixture of convex multiple scaled generalized hyperbolic distributions (cMSGHD) and the mixture of coaelesed generalized hyperbolic distributions (MCGHD).

Usage

1
2
DA(train,trainL,test,testL,method="MGHD",max.iter=100,
	eps=1e-2,q=2,scale=TRUE,seed=12345)

Arguments

train

A n1 x p matrix or data frame such that rows correspond to observations and columns correspond to variables of the training data set.

trainL

A n1 dimensional vector of membership for the units of the training set. If trainL[i]=k then observation belongs to group k.

test

A n2 x p matrix or data frame such that rows correspond to observations and columns correspond to variables of the test data set.

testL

A n2 dimensional vector of membership for the units of the test set. If testL[i]=k then observation belongs to group k.

method

( optional) A string indicating the method to be used form discriminant analysis , if not specified MGHD is used. Alternative methods are: MGHFA, MSGHD, cMSGHD, MCGHD.

max.iter

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

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.

q

(optional) used only if MGHFA method is selected. A numerical parameter giving the number of factors.

scale

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

seed

( optional) A number giving the pseudo-random number seed to be used. If NULL a pseudo-random number is used, by default 12345.

Value

A list with components

model

A list with the model parameters.

testMembership

A vector of integers indicating the membership of the units in the test set

ARI

A value indicating the adjusted rand index for the test set.

Author(s)

Cristina Tortora Maintainer: Cristina Tortora <ctortora@mcmaster.ca>

References

R.P. Browne, and P.D. McNicholas (2013). A Mixture of Generalized Hyperbolic Distributions. Arxiv preprint arXiv:1305.1036
C. Tortora, B.C. Franczak, R.P. Browne, and P.D. McNicholas (2014). A Mixture of Coalesced Generalized Hyperbolic Distributions. Arxiv preprint arXiv:1403.2332
C. Tortora, P.D. McNicholas, and R.P. Browne (2014). A Mixture of Generalized Hyperbolic Factor Analyzers. Arxiv preprint arXiv:1311.6530

See Also

MGHD MGHFA MSGHD cMSGHD MCGHD ARI

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
##loading banknote data
data(banknote)
banknote[,1]=as.numeric(factor(banknote[,1]))


##divide the data in training set and test set
train=banknote[c(1:74,126:200),]
test=banknote[75:125,]

##model estimation
 model=DA(train[,2:7],train[,1],test[,2:7],test[,1],method="MSGHD",max.iter=20)

#result
model$ARItest

MixGHD documentation built on May 2, 2019, 5:49 p.m.

Related to DA in MixGHD...