fmmst: Fitting Finite Mixtures of Unrestricted Multivariate Skew t...

Description Usage Arguments Details Value References See Also Examples

View source: R/fmmst.r

Description

Computes maximum likelihood estimators (MLE) for finite mixtures of unrestricted multivariate skew t (FM-MST) model via the EM algorithm.

Usage

1
2
3
4
5
6
fmmst(g = 1, dat, initial = NULL, known = NULL, itmax = 100, 
    eps = 1e-03, clust=NULL, nkmeans=20, print = T, tmethod=1)
## S3 method for class 'fmmst'
summary(object, ...)
## S3 method for class 'fmmst'
print(x, ...)                     

Arguments

object, x

an object class of class "fmmst", i.e. a fitted model.

g

a scalar specifying the number of components in the mixture model

dat

the data matrix giving the coordinates of the point(s) where the density is evaluated. This is either a vector of length p or a matrix with p columns.

initial

(optional) a list containing the initial parameters of the mixture model. See the 'Details' section. The default is NULL.

known

(optional) a list containing parameters of the mixture model that are known and not required to be estimated. See the 'Details' section. The default is NULL.

itmax

(optional) a positive integer specifying the maximum number of EM iterations to perform. The default is 100.

eps

(optional) a numeric value used to control the termination criteria for the EM loops. It is the maximum tolerance for the absolute difference between the log-likelihood value and the asymptotic log likelihood value. The default is 1e-6.

clust

(optional) a numeric value of length nrow(dat) containing the initial labels for each data point in dat. The default is NULL, indicating no initial clustering is known.

nkmeans

(optional) a numeric value indicating how many k-means trials to be used when searching for initial values. The default is 20.

print

(optional) a logical value. If TRUE, output for each iteration will be printed out. if FALSE, no output is printed. The default is TRUE. See the 'Details' section.

tmethod

(optional) an integer indicating which method to use when computing t distribution function values. See pmt for details.

...

not used.

Details

The arguments init and known, if specified, is a list structure containing at least one of mu, sigma, delta, dof, pro (See dfmmst for the structure of each of these elements). If init=FALSE (default), the program uses an automatic approach based on k-means clustering to generate an initial value for the model parameters. Note that this may not provide the best results.

As the EM algorithm is sensitive to the starting value, it is highly recommended to apply a wide range different initializations. A simple strategy is implemented in fmmst.init.

Value

mu

a list of g numeric matrices containing the location parameter for each component.

sigma

a list of g numeric matrices containing the scale parameter for each component.

delta

a list of g numeric matrices containing the skewness parameter for each component.

dof

a numeric vector of length g representing the degrees of freedom for each component.

pro

a vector of length of g specifying the mixing proportions for each component.

tau

an g by n matrix of posterior probability of component membership.

clusters

a vector of length n of final partition.

loglik

the final log likelihood value.

lk

a vector of log likelihood values at each EM iteration.

iter

number of iterations performed.

eps

the final absolute difference between the log likelihood value and the asymptotic log likelihood value.

aic, bic

Akaike Information Criterion (AIC), Bayes Information Criterion (BIC)

References

Lee S, McLachlan G (2011). On the fitting of mixtures of multivariate skew t-distributions via the EM algorithm. arXiv:1109.4706 [stat.ME]

Lee, S. and McLachlan, G.J. (2014) Finite mixtures of multivariate skew t-distributions: some recent and new results. Statistics and Computing, 24, 181-202.

Lee, S. and McLachlan, G.J. (2013) EMMIXuskew: An R package for fitting mixtures of multivariate skew t-distributions via the EM algorithm. Journal of Statistical Software, 55(12), 1-22. URL http://www.jstatsoft.org/v55/i12/.

See Also

fmmst.init, rfmmst, dfmmst, fmmst.contour.2d

Examples

1
2
3
4
5
#a short demo using AIS data
data(ais)
Fit <- fmmst(2, ais[,c(2,12)], itmax=5) 
summary(Fit)
print(Fit)

Example output

Loading required package: MASS
Finite Mixture of Multivariate Skew t-distribution
with  2 components
  ----------------------------------------------------

  Iteration  0 : loglik =  -1375.755 
  Iteration  1 : loglik =  -1372.719 
  Iteration  2 : loglik =  -1370.503 
  Iteration  3 : loglik =  -1368.776 
  Iteration  4 : loglik =  -1367.395 
  Iteration  5 : loglik =  -1366.256 
  ----------------------------------------------------
  Iteration 5: loglik = -1366.256

Component means:
           [,1]       [,2]
[1,] 182.126977 181.094629
[2,]   5.725095   8.418986


Component scale matrices:
[[1]]
           [,1]      [,2]
[1,] 11.4682797 0.7770157
[2,]  0.7770157 2.6873680

[[2]]
         [,1]      [,2]
[1,] 9.967333  7.325116
[2,] 7.325116 10.900295


Component skewness parameters:
         [,1]      [,2]
[1,] 7.931061 -9.187155
[2,] 6.298261  8.926576


Component degrees of freedom:
38.77001 41.18913 

Component mixing proportions:
0.4263113 0.5736887 

Finite Mixture of Multivarate Skew t-distributions
with  2  components

Component means:
           [,1]       [,2]
[1,] 182.126977 181.094629
[2,]   5.725095   8.418986


Component scale matrices:
[[1]]
           [,1]      [,2]
[1,] 11.4682797 0.7770157
[2,]  0.7770157 2.6873680

[[2]]
         [,1]      [,2]
[1,] 9.967333  7.325116
[2,] 7.325116 10.900295


Component skewness parameters:
         [,1]      [,2]
[1,] 7.931061 -9.187155
[2,] 6.298261  8.926576


Component degrees of freedom:
38.77001 41.18913 

Component mixing proportions:
0.4263113 0.5736887 

$pro
[1] 0.4263113 0.5736887

$mu
$mu[[1]]
           [,1]
[1,] 182.126977
[2,]   5.725095

$mu[[2]]
           [,1]
[1,] 181.094629
[2,]   8.418986


$sigma
$sigma[[1]]
           [,1]      [,2]
[1,] 11.4682797 0.7770157
[2,]  0.7770157 2.6873680

$sigma[[2]]
         [,1]      [,2]
[1,] 9.967333  7.325116
[2,] 7.325116 10.900295


$delta
$delta[[1]]
         [,1]
[1,] 7.931061
[2,] 6.298261

$delta[[2]]
          [,1]
[1,] -9.187155
[2,]  8.926576


$dof
[1] 38.77001 41.18913

$tau
             [,1]       [,2]       [,3]      [,4]      [,5]        [,6]
[1,] 0.9998759186 0.93714322 0.03017676 0.2944467 0.5838414 0.007161885
[2,] 0.0001240814 0.06285678 0.96982324 0.7055533 0.4161586 0.992838115
          [,7]        [,8]         [,9]   [,10]      [,11]      [,12]
[1,] 0.6702328 0.002357614 0.0009523704 0.16948 0.96229317 0.94885165
[2,] 0.3297672 0.997642386 0.9990476296 0.83052 0.03770683 0.05114835
            [,13]     [,14]      [,15]      [,16]      [,17]      [,18]
[1,] 0.0001025849 0.0454367 0.03147941 0.06904956 0.04908538 0.09800578
[2,] 0.9998974151 0.9545633 0.96852059 0.93095044 0.95091462 0.90199422
         [,19]      [,20]     [,21]      [,22]       [,23]     [,24]     [,25]
[1,] 0.4244983 0.01556741 0.1093494 0.01405254 0.004247963 0.3307743 0.5835683
[2,] 0.5755017 0.98443259 0.8906506 0.98594746 0.995752037 0.6692257 0.4164317
         [,26]      [,27]       [,28]        [,29]      [,30]     [,31]
[1,] 0.2994598 0.04242444 0.005270056 1.175658e-08 0.05331546 0.1135514
[2,] 0.7005402 0.95757556 0.994729944 1.000000e+00 0.94668454 0.8864486
          [,32]     [,33]    [,34]     [,35]      [,36]        [,37]      [,38]
[1,] 0.09793356 0.0244225 0.120719 0.6592509 0.07116022 0.0007452455 0.01318239
[2,] 0.90206644 0.9755775 0.879281 0.3407491 0.92883978 0.9992547545 0.98681761
            [,39]     [,40]      [,41]      [,42]       [,43]       [,44]
[1,] 0.0002742872 0.1503655 0.06000756 0.01841932 0.001407294 0.004064201
[2,] 0.9997257128 0.8496345 0.93999244 0.98158068 0.998592706 0.995935799
           [,45]      [,46]     [,47]       [,48]        [,49]        [,50]
[1,] 0.001476746 0.02764118 0.5535145 0.006438722 0.0008751984 0.0001377015
[2,] 0.998523254 0.97235882 0.4464855 0.993561278 0.9991248016 0.9998622985
           [,51]       [,52]        [,53]     [,54]      [,55]       [,56]
[1,] 0.001349252 0.007137324 0.0002775852 0.5341756 0.02567962 0.002787439
[2,] 0.998650748 0.992862676 0.9997224148 0.4658244 0.97432038 0.997212561
         [,57]        [,58]        [,59]        [,60]     [,61]      [,62]
[1,] 0.1379046 0.0009479905 0.0005136197 0.0007421358 0.1449849 0.00312072
[2,] 0.8620954 0.9990520095 0.9994863803 0.9992578642 0.8550151 0.99687928
           [,63]    [,64]      [,65]        [,66]        [,67]        [,68]
[1,] 0.009630327 0.324631 0.01961144 0.0008834766 1.191931e-05 0.0006111342
[2,] 0.990369673 0.675369 0.98038856 0.9991165234 9.999881e-01 0.9993888658
          [,69]      [,70]        [,71]        [,72]      [,73]       [,74]
[1,] 0.01469694 0.00560461 0.0005947097 0.0008388549 0.01083147 0.000898157
[2,] 0.98530306 0.99439539 0.9994052903 0.9991611451 0.98916853 0.999101843
            [,75]       [,76]     [,77]        [,78]        [,79]        [,80]
[1,] 0.0008722512 0.004022883 0.1391564 1.206697e-06 5.787954e-05 1.550174e-06
[2,] 0.9991277488 0.995977117 0.8608436 9.999988e-01 9.999421e-01 9.999984e-01
            [,81]        [,82]        [,83]      [,84]        [,85]       [,86]
[1,] 0.0007660721 3.922871e-06 2.629853e-05 0.05309207 5.807131e-06 0.005914419
[2,] 0.9992339279 9.999961e-01 9.999737e-01 0.94690793 9.999942e-01 0.994085581
          [,87]      [,88]       [,89]        [,90]     [,91]        [,92]
[1,] 0.09209575 0.00018962 0.003676475 5.742299e-05 0.0272106 1.334660e-06
[2,] 0.90790425 0.99981038 0.996323525 9.999426e-01 0.9727894 9.999987e-01
           [,93]        [,94]      [,95]        [,96]        [,97]        [,98]
[1,] 0.002782172 5.862402e-05 0.01920249 7.683559e-08 1.340007e-07 2.535098e-08
[2,] 0.997217828 9.999414e-01 0.98079751 9.999999e-01 9.999999e-01 1.000000e+00
            [,99]       [,100]      [,101]    [,102]     [,103]       [,104]
[1,] 1.542307e-10 1.359515e-10 0.009577232 0.1355241 0.98457527 1.000000e+00
[2,] 1.000000e+00 1.000000e+00 0.990422768 0.8644759 0.01542473 4.181028e-08
           [,105]    [,106]     [,107]     [,108]       [,109]     [,110]
[1,] 1.000000e+00 0.5032857 0.90601565 0.97376261 9.999991e-01 0.99003427
[2,] 3.027051e-08 0.4967143 0.09398435 0.02623739 9.066937e-07 0.00996573
         [,111]       [,112]       [,113]       [,114]    [,115]       [,116]
[1,] 0.97300274 9.999997e-01 9.999986e-01 9.999882e-01 0.4901118 0.9997055107
[2,] 0.02699726 2.949209e-07 1.433555e-06 1.177044e-05 0.5098882 0.0002944893
           [,117]     [,118]       [,119]      [,120]       [,121]      [,122]
[1,] 1.000000e+00 0.98957485 9.999965e-01 0.990605161 1.964559e-05 0.994833664
[2,] 6.732545e-11 0.01042515 3.548511e-06 0.009394839 9.999804e-01 0.005166336
           [,123]       [,124]     [,125]      [,126]       [,127]      [,128]
[1,] 0.9998049168 9.999999e-01 0.98700544 1.00000e+00 9.999742e-01 0.995442311
[2,] 0.0001950832 5.166193e-08 0.01299456 4.93555e-08 2.580767e-05 0.004557689
           [,129]       [,130]       [,131]       [,132]       [,133]
[1,] 1.000000e+00 1.000000e+00 9.999999e-01 0.9992008099 1.000000e+00
[2,] 4.712247e-12 2.894134e-09 7.980299e-08 0.0007991901 2.015846e-13
           [,134]       [,135]       [,136]       [,137]      [,138]
[1,] 1.000000e+00 1.000000e+00 0.9997818289 1.000000e+00 0.998438284
[2,] 4.015469e-13 1.145899e-09 0.0002181711 2.816621e-09 0.001561716
           [,139]       [,140]       [,141]       [,142]      [,143]    [,144]
[1,] 9.999992e-01 1.000000e+00 0.0009658014 0.9998606357 0.995784807 0.9984406
[2,] 7.882494e-07 3.412483e-09 0.9990341986 0.0001393643 0.004215193 0.0015594
        [,145]     [,146]      [,147]     [,148]       [,149]   [,150]
[1,] 0.8392222 0.95296893 0.997912154 0.06336282 0.9991606436 0.874618
[2,] 0.1607778 0.04703107 0.002087846 0.93663718 0.0008393564 0.125382
        [,151]    [,152]     [,153]       [,154]      [,155]     [,156]
[1,] 0.1395799 0.1503868 0.03380488 9.999995e-01 0.004376436 0.03929143
[2,] 0.8604201 0.8496132 0.96619512 4.961904e-07 0.995623564 0.96070857
        [,157]    [,158]       [,159]      [,160]       [,161]     [,162]
[1,] 0.7746092 0.4517992 9.999967e-01 0.990797748 9.999677e-01 0.08394098
[2,] 0.2253908 0.5482008 3.304827e-06 0.009202252 3.227918e-05 0.91605902
        [,163]     [,164]     [,165]     [,166]    [,167]    [,168]    [,169]
[1,] 0.9946992 0.97719045 0.99870494 0.03310229 0.8570636 0.4211694 0.0191177
[2,] 0.0053008 0.02280955 0.00129506 0.96689771 0.1429364 0.5788306 0.9808823
        [,170]     [,171]    [,172]    [,173]      [,174]    [,175]
[1,] 0.6626237 0.05496518 0.4165535 0.2883269 0.003099098 0.3787094
[2,] 0.3373763 0.94503482 0.5834465 0.7116731 0.996900902 0.6212906
           [,176]       [,177]     [,178]    [,179]    [,180]     [,181]
[1,] 0.9998490858 1.000000e+00 0.08335613 0.1155384 0.3675864 0.04901295
[2,] 0.0001509142 6.976888e-09 0.91664387 0.8844616 0.6324136 0.95098705
          [,182]    [,183]       [,184]    [,185]       [,186]       [,187]
[1,] 0.997946589 0.3075857 9.999859e-01 0.3552272 9.999611e-01 0.9996194701
[2,] 0.002053411 0.6924143 1.410759e-05 0.6447728 3.888396e-05 0.0003805299
        [,188]       [,189]       [,190]       [,191]       [,192]      [,193]
[1,] 0.4558908 9.999993e-01 9.999694e-01 9.999997e-01 9.999500e-01 0.999800337
[2,] 0.5441092 7.291228e-07 3.063712e-05 3.242120e-07 5.001844e-05 0.000199663
          [,194]       [,195]    [,196]    [,197]    [,198]    [,199]    [,200]
[1,] 0.990449995 9.999425e-01 0.8132804 0.3816304 0.8370515 0.8989452 0.9407401
[2,] 0.009550005 5.745154e-05 0.1867196 0.6183696 0.1629485 0.1010548 0.0592599
        [,201]       [,202]
[1,] 0.1550315 9.999993e-01
[2,] 0.8449685 6.905201e-07

$clusters
  [1] 1 1 2 2 1 2 1 2 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 1 2 2
 [38] 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
 [75] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1
[112] 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 2
[149] 1 1 2 2 2 1 2 2 1 2 1 1 1 2 1 1 1 2 1 2 2 1 2 2 2 2 2 1 1 2 2 2 2 1 2 1 2
[186] 1 1 2 1 1 1 1 1 1 1 1 2 1 1 1 2 1

$loglik
[1] -1366.256

$lk
[1] -1375.755 -1372.719 -1370.503 -1368.776 -1367.395 -1366.256

$iter
[1] 5

$eps
[1] 1.138409

$aic
[1] 2766.512

$bic
[1] 2822.753

attr(,"class")
[1] "fmmst"

EMMIXuskew documentation built on May 29, 2017, 11:25 p.m.