Running ‘testthat.R’ [389s/508s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # MixtComp version 4 - july 2019
  > # Copyright (C) Inria - Université de Lille - CNRS 
  > 
  > # This program is free software: you can redistribute it and/or modify
  > # it under the terms of the GNU Affero General Public License as
  > # published by the Free Software Foundation, either version 3 of the
  > # License, or (at your option) any later version.
  > # This program is distributed in the hope that it will be useful,
  > # but WITHOUT ANY WARRANTY; without even the implied warranty of
  > # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  > # GNU Affero General Public License for more details.
  > # 
  > # You should have received a copy of the GNU Affero General Public License
  > # along with this program.  If not, see <https://www.gnu.org/licenses/>
  >  
  > 
  > library(testthat)
  > library(RMixtComp)
  Loading required package: RMixtCompUtilities
  > 
  > test_check("RMixtComp")
  ====== Run Hierarchical MixtComp in  mode with 1 run(s) per number of classes and 1 core(s)
  Data:  individuals and 3 variables.
  -- K = 2
  Number of splits to perform: 1
   Split a cluster in two
  Start run 1
  Run 1 DONE 
   Compute criterion
  Run time: 0.028s
  -- K = 3
  Number of splits to perform: 2
   Split a cluster in two
  Start run 1
  Run 1 DONE 
   Split a cluster in two
  Start run 1
  Run 1 DONE 
   Compute criterion
  Start run 1
  Run 1 DONE 
  Start run 1
  Run 1 DONE 
  Run time: 0.116s
  -- K = 4
  Number of splits to perform: 2
   Split a cluster in two
  Start run 1
  Run 1 DONE 
   Split a cluster in two
  Start run 1
  Run 1 DONE 
   Compute criterion
  Start run 1
  Run 1 DONE 
  Start run 1
  Run 1 DONE 
  Start run 1
  Run 1 DONE 
  Run time: 0.199s
  You did not provide a model parameter.
  Data are assumed to follow R standard and not MixtComp standard.
  Models will be imputed as follows: "Gaussian" for numeric variable, "Multinomial" for character or factor variable and "Poisson" for integer variable.
  If a variable is named "z_class" and its type is character, factor or integer, it will be used as "LatentClass".
           cont         categ         poiss 
     "Gaussian" "Multinomial"     "Poisson" 
  ====== Run MixtComp in learn mode with 1 run(s) per number of classes and 1 core(s)
  Data: 200 individuals and 3 variables.
  -- K = 2
  Start run 1
  Run 1 DONE 
  Run completed in 0.083s
  Total runtime: 0.148s
  Best model according to BIC: 2 clusters.
  ── 1. Failure: mixtCompLearn works in basic mode + predict (@test.runWrapper.R#3
  RMixtCompIO:::rand.index(getPartition(resLearn), rep(1:2, each = 100)) is not more than 0.95. Difference: -0.162
  
  ── 2. Failure: mixtCompLearn works in basic mode + predict (@test.runWrapper.R#5
  RMixtCompIO:::rand.index(getPartition(resPredict), rep(1:2, each = 100)) is not more than 0.95. Difference: -0.162
  
  You did not provide a model parameter.
  Data are assumed to follow R standard and not MixtComp standard.
  Models will be imputed as follows: "Gaussian" for numeric variable, "Multinomial" for character or factor variable and "Poisson" for integer variable.
  If a variable is named "z_class" and its type is character, factor or integer, it will be used as "LatentClass".
           cont        categ1        categ2         poiss 
     "Gaussian" "Multinomial" "Multinomial"     "Poisson" 
  ====== Run MixtComp in learn mode with 1 run(s) per number of classes and 1 core(s)
  Data: 200 individuals and 4 variables.
  -- K = 2
  Start run 1
  Run 1 DONE 
  Run completed in 0.057s
  Total runtime: 0.124s
  Best model according to BIC: 2 clusters.
  You did not provide a model parameter.
  Data are assumed to follow R standard and not MixtComp standard.
  Models will be imputed as follows: "Gaussian" for numeric variable, "Multinomial" for character or factor variable and "Poisson" for integer variable.
  If a variable is named "z_class" and its type is character, factor or integer, it will be used as "LatentClass".
           cont         poiss       z_class 
     "Gaussian"     "Poisson" "LatentClass" 
  ====== Run MixtComp in learn mode with 1 run(s) per number of classes and 1 core(s)
  Data: 200 individuals and 3 variables.
  -- K = 2
  Start run 1
  Run 1 DONE 
  Run completed in 0.034s
  Total runtime: 0.078s
  Best model according to BIC: 2 clusters.
  You did not provide a model parameter.
  Data are assumed to follow R standard and not MixtComp standard.
  Models will be imputed as follows: "Gaussian" for numeric variable, "Multinomial" for character or factor variable and "Poisson" for integer variable.
  If a variable is named "z_class" and its type is character, factor or integer, it will be used as "LatentClass".
   Sepal.Length   Sepal.Width  Petal.Length   Petal.Width       z_class 
     "Gaussian"    "Gaussian"    "Gaussian"    "Gaussian" "LatentClass" 
  ====== Run MixtComp in learn mode with 1 run(s) per number of classes and 1 core(s)
  Data: 150 individuals and 5 variables.
  -- K = 3
  Start run 1
  Run 1 DONE 
  Run completed in 0.035s
  Total runtime: 0.087s
  Best model according to BIC: 3 clusters.
     
        1   2   3   4
    1   8   6  17 363
    2 602  28   5   9
    3   6   3 291   7
    4  27 617   6   5
  ====== Run MixtComp in learn mode with 5 run(s) per number of classes and 1 core(s)
  Data: 1000 individuals and 2 variables.
  -- K = 2
  Start run 1
  Run 1 DONE 
  Start run 2
  Run 2 DONE 
  Start run 3
  Run 3 DONE 
  Start run 4
  Run 4 DONE 
  Start run 5
  Run 5 DONE 
  Run completed in 1.737s
  -- K = 3
  Start run 1
  Run 1 DONE 
  Start run 2
  Run 2 DONE 
  Start run 3
  Run 3 DONE 
  Start run 4
  Run 4 DONE 
  Start run 5
  Run 5 DONE 
  Run completed in 1.99s
  -- K = 4
  Start run 1
  Run 1 DONE 
  Start run 2
  Run 2 DONE 
  Start run 3
  Run 3 DONE 
  Start run 4
  Run 4 DONE 
  Start run 5
  Run 5 DONE 
  Run completed in 1.928s
  -- K = 5
  Start run 1
  Run 1 DONE 
  Start run 2
  Run 2 DONE 
  Start run 3
  Run 3 DONE 
  Start run 4
  Run 4 DONE 
  Start run 5
  Run 5 DONE 
  Run completed in 3.165s
  Total runtime: 8.823s
  Best model according to BIC: 4 clusters.
     
        1   2   3   4
    1 186   3   5   3
    2   5  20   1 283
    3   4   2 144   2
    4   4 326   3   9
  ############### MixtCompLearn Run ###############
  nClass: 2 3 4 5 
  Criterion used: BIC 
              2         3         4         5
  BIC -2461.953 -2330.738 -2278.821 -2287.100
  ICL -2498.222 -2401.026 -2376.834 -2412.171
  Best model: 4 clusters 
  ########### MixtComp Run ###########
  Number of individuals: 1000 
  Number of variables: 1 
  Number of clusters: 4 
  Mode: learn 
  Time: 0.297 s
  SEM burn-in iterations done: 72/100 
  SEM run iterations done: 11/100 
  Observed log-likelihood: -2240.828 
  BIC: -2278.821 
  ICL: -2376.834 
  Discriminative power:
  Gaussian1 
      0.902 
  Proportions of the mixture:
  0.201 0.34 0.147 0.312 
  Parameters of the most discriminant variables:
  - Gaussian1: Gaussian 
         mean    sd
  k: 1 -5.037 1.030
  k: 2  2.033 0.520
  k: 3 -1.988 0.517
  k: 4  5.007 0.985
  ####################################
  ########### MixtComp Run ###########
  Number of individuals: 1000 
  Number of variables: 1 
  Number of clusters: 2 
  Mode: learn 
  Time: 0.301 s
  SEM burn-in iterations done: 33/100 
  SEM run iterations done: 11/100 
  Observed log-likelihood: -2444.684 
  BIC: -2461.953 
  ICL: -2498.222 
  Discriminative power:
  Gaussian1 
      0.905 
  Proportions of the mixture:
  0.348 0.652 
  Parameters of the most discriminant variables:
  - Gaussian1: Gaussian 
         mean    sd
  k: 1 -3.731 1.745
  k: 2  3.380 1.751
  ####################################
  $nClass: 2 3 4 5 
  $criterion:  BIC 
  $crit: 
              2         3         4         5
  BIC -2461.953 -2330.738 -2278.821 -2287.100
  ICL -2498.222 -2401.026 -2376.834 -2412.171
  
   Best result
  $algo
  $algo$nInd: 1000 
  $algo$nClass: 4 
  $algo$mode: learn 
  	 Other outputs: nbBurnInIter nbIter nbGibbsBurnInIter nbGibbsIter nSemTry nInitPerClass confidenceLevel ratioStableCriterion nStableCriterion basicMode hierarchicalMode 
  
  $mixture
  $mixture$lnObservedLikelihood: -2240.828 
  $mixture$nbFreeParameters: 11 
  $mixture$BIC: -2278.821 
  $mixture$ICL: -2376.834 
  	 Other outputs: runTime lnCompletedLikelihood IDClass lnProbaGivenClass completedProbabilityLogBurnIn completedProbabilityLogRun delta 
  
  $variable
  $variable$type
  $variable$type$z_class :  LatentClass 
  $variable$type$Gaussian1 :  Gaussian 
  
  $variable$data
  $variable$data$z_class$completed:  1 1 4 3 4 3 ...
  $variable$data$z_class$stat:
        k: 1 k: 2 k: 3 k: 4
  [1,] 1.00 0.00 0.00 0.00
  [2,] 1.00 0.00 0.00 0.00
  [3,] 0.00 0.00 0.00 1.00
  [4,] 0.01 0.00 0.99 0.00
  [5,] 0.00 0.01 0.00 0.99
  [6,] 0.00 0.00 1.00 0.00
  
  	 Other variables: Gaussian1 
  
  $variable$param
  $variable$param$z_class: 
       median q 2.500000% q 97.500000%
  k: 1  0.201   0.2006141    0.2003910
  k: 2  0.340   0.3418628    0.3401760
  k: 3  0.147   0.1463664    0.1485826
  k: 4  0.312   0.3111566    0.3108504
  $variable$param$Gaussian1: 
                   median q 2.500000% q 97.500000%
  k: 1, mean:  -5.0370946  -5.0585039   -4.9760728
  k: 1, sd      1.0295772   0.9694843    1.0749386
  k: 2, mean:   2.0329055   2.0077128    2.0520984
  k: 2, sd      0.5197190   0.5037070    0.5396148
  k: 3, mean:  -1.9882183  -2.0226496   -1.9671359
  k: 3, sd      0.5174002   0.5068921    0.5298175
  k: 4, mean:   5.0069869   4.9603612    5.0463423
  k: 4, sd      0.9846369   0.9323094    1.0149470
  
   $res: results from all MixtComp Run
  $algo
  $algo$nInd: 1000 
  $algo$nClass: 2 
  $algo$mode: learn 
  	 Other outputs: nbBurnInIter nbIter nbGibbsBurnInIter nbGibbsIter nSemTry nInitPerClass confidenceLevel ratioStableCriterion nStableCriterion basicMode hierarchicalMode 
  
  $mixture
  $mixture$lnObservedLikelihood: -2444.684 
  $mixture$nbFreeParameters: 5 
  $mixture$BIC: -2461.953 
  $mixture$ICL: -2498.222 
  	 Other outputs: runTime lnCompletedLikelihood IDClass lnProbaGivenClass completedProbabilityLogBurnIn completedProbabilityLogRun delta 
  
  $variable
  $variable$type
  $variable$type$z_class :  LatentClass 
  $variable$type$Gaussian1 :  Gaussian 
  
  $variable$data
  $variable$data$z_class$completed:  1 1 2 1 2 1 ...
  $variable$data$z_class$stat:
        k: 1 k: 2
  [1,] 1.00 0.00
  [2,] 1.00 0.00
  [3,] 0.00 1.00
  [4,] 0.82 0.18
  [5,] 0.00 1.00
  [6,] 0.76 0.24
  
  	 Other variables: Gaussian1 
  
  $variable$param
  $variable$param$z_class: 
       median q 2.500000% q 97.500000%
  k: 1  0.348    0.343465    0.3474827
  k: 2  0.652    0.656535    0.6525173
  $variable$param$Gaussian1: 
                  median q 2.500000% q 97.500000%
  k: 1, mean:  -3.730738   -3.838506    -3.693009
  k: 1, sd      1.745050    1.699419     1.797639
  k: 2, mean:   3.380252    3.315987     3.439364
  k: 2, sd      1.750822    1.700825     1.804240
  Start run 1
  Run 1 DONE 
  ====== Run Hierarchical MixtComp in learn mode with 2 run(s) per number of classes and 1 core(s)
  Data: 200 individuals and 3 variables.
  -- K = 2
  Number of splits to perform: 1
   Split a cluster in two
  Start run 1
  Run 1 DONE 
  Start run 2
  Run 2 DONE 
   Compute criterion
  Run time: 22.577s
  -- K = 3
  Number of splits to perform: 2
   Split a cluster in two
  Start run 1
  Run 1 DONE 
  Start run 2
  Run 2 DONE 
   Split a cluster in two
  Start run 1
  Run 1 DONE 
  Start run 2
  Run 2 DONE 
   Compute criterion
  Start run 1
  Run 1 DONE 
  Start run 2
  Run 2 DONE 
  Start run 1
  Run 1 DONE 
  Start run 2
  Run 2 DONE 
  Run time: 84.8s
  Total runtime: 107.379s
  Best model according to BIC: 2 clusters.
  ############### MixtCompLearn Run ###############
  nClass: 2 3 
  Criterion used: BIC 
              2         3
  BIC -23052.93 -23071.23
  ICL      -Inf -23107.78
  Best model: 2 clusters 
  ########### MixtComp Run ###########
  Number of individuals: 200 
  Number of variables: 2 
  Number of clusters: 2 
  Mode: learn 
  Time: 10.526 s
  SEM burn-in iterations done: 11/50 
  SEM run iterations done: 11/50 
  Observed log-likelihood: -22997.3 
  BIC: -23052.93 
  ICL: -Inf 
  Discriminative power:
  Functional1   Gaussian1 
        1.000       0.959 
  Proportions of the mixture:
  0.685 0.315 
  Parameters of the most discriminant variables:
  - Functional1: Func_CS 
  $alpha
       s:1, alpha0 s:1, alpha1 s:2, alpha0 s:2, alpha1
  k: 1           0           0  -2028959.7   201094.71
  k: 2           0           0   -110146.1    10986.47
  
  $beta
       s:1, c:1 s:1, c:2 s:2, c:1 s:2, c:2
  k: 1    8.289   -0.988  -11.791    1.008
  k: 2    1.684    0.995   21.866   -1.013
  
  $sd
         s:1   s:2
  k: 1 0.762 0.736
  k: 2 0.751 0.747
  
  - Gaussian1: Gaussian 
         mean    sd
  k: 1  4.913 1.145
  k: 2 -4.913 0.992
  ####################################
  ########### MixtComp Run ###########
  Number of individuals: 200 
  Number of variables: 2 
  Number of clusters: 2 
  Mode: learn 
  Time: 10.526 s
  SEM burn-in iterations done: 11/50 
  SEM run iterations done: 11/50 
  Observed log-likelihood: -22997.3 
  BIC: -23052.93 
  ICL: -Inf 
  Discriminative power:
  Functional1   Gaussian1 
        1.000       0.959 
  Proportions of the mixture:
  0.685 0.315 
  Parameters of the most discriminant variables:
  - Functional1: Func_CS 
  $alpha
       s:1, alpha0 s:1, alpha1 s:2, alpha0 s:2, alpha1
  k: 1           0           0  -2028959.7   201094.71
  k: 2           0           0   -110146.1    10986.47
  
  $beta
       s:1, c:1 s:1, c:2 s:2, c:1 s:2, c:2
  k: 1    8.289   -0.988  -11.791    1.008
  k: 2    1.684    0.995   21.866   -1.013
  
  $sd
         s:1   s:2
  k: 1 0.762 0.736
  k: 2 0.751 0.747
  
  - Gaussian1: Gaussian 
         mean    sd
  k: 1  4.913 1.145
  k: 2 -4.913 0.992
  ####################################
  $nClass: 2 3 
  $criterion:  BIC 
  $crit: 
              2         3
  BIC -23052.93 -23071.23
  ICL      -Inf -23107.78
  
   Best result
  $algo
  $algo$nInd: 200 
  $algo$nClass: 2 
  $algo$mode: learn 
  	 Other outputs: nbBurnInIter nbIter nbGibbsBurnInIter nbGibbsIter nSemTry nInitPerClass confidenceLevel ratioStableCriterion nStableCriterion basicMode hierarchicalMode 
  
  $mixture
  $mixture$lnObservedLikelihood: -22997.3 
  $mixture$nbFreeParameters: 21 
  $mixture$BIC: -23052.93 
  $mixture$ICL: -Inf 
  	 Other outputs: runTime lnCompletedLikelihood IDClass lnProbaGivenClass completedProbabilityLogBurnIn completedProbabilityLogRun delta 
  
  $variable
  $variable$type
  $variable$type$z_class :  LatentClass 
  $variable$type$Functional1 :  Func_CS 
  $variable$type$Gaussian1 :  Gaussian 
  
  $variable$data
  $variable$data$z_class$completed:  1 2 1 2 2 1 ...
  $variable$data$z_class$stat:
        k: 1 k: 2
  [1,]    1    0
  [2,]    0    1
  [3,]    1    0
  [4,]    0    1
  [5,]    0    1
  [6,]    1    0
  
  	 Other variables: Functional1 Gaussian1 
  
  $variable$param
  $variable$param$z_class: 
       median q 2.500000% q 97.500000%
  k: 1  0.685       0.685        0.685
  k: 2  0.315       0.315        0.315
  $variable$param$Functional1: 
  NULL
  $variable$param$Gaussian1: 
                   median q 2.500000% q 97.500000%
  k: 1, mean:   4.9131339    4.898777     4.951588
  k: 1, sd      1.1447128    1.125090     1.164811
  k: 2, mean:  -4.9128628   -4.971944    -4.875601
  k: 2, sd      0.9924999    0.965925     1.025499
  
   $res: results from all MixtComp Run
  $algo
  $algo$nInd: 200 
  $algo$nClass: 2 
  $algo$mode: learn 
  	 Other outputs: nbBurnInIter nbIter nbGibbsBurnInIter nbGibbsIter nSemTry nInitPerClass confidenceLevel ratioStableCriterion nStableCriterion 
  
  $mixture
  $mixture$lnObservedLikelihood: -22997.3 
  $mixture$nbFreeParameters: 21 
  $mixture$BIC: -23052.93 
  $mixture$ICL: -Inf 
  	 Other outputs: runTime lnCompletedLikelihood IDClass lnProbaGivenClass completedProbabilityLogBurnIn completedProbabilityLogRun delta 
  
  $variable
  $variable$type
  $variable$type$z_class :  LatentClass 
  $variable$type$Functional1 :  Func_CS 
  $variable$type$Gaussian1 :  Gaussian 
  
  $variable$data
  $variable$data$z_class$completed:  1 2 1 2 2 1 ...
  $variable$data$z_class$stat:
        k: 1 k: 2
  [1,]    1    0
  [2,]    0    1
  [3,]    1    0
  [4,]    0    1
  [5,]    0    1
  [6,]    1    0
  
  	 Other variables: Functional1 Gaussian1 
  
  $variable$param
  $variable$param$z_class: 
       median q 2.500000% q 97.500000%
  k: 1  0.685       0.685        0.685
  k: 2  0.315       0.315        0.315
  $variable$param$Functional1: 
  NULL
  $variable$param$Gaussian1: 
                   median q 2.500000% q 97.500000%
  k: 1, mean:   4.9131339    4.898777     4.951588
  k: 1, sd      1.1447128    1.125090     1.164811
  k: 2, mean:  -4.9128628   -4.971944    -4.875601
  k: 2, sd      0.9924999    0.965925     1.025499
  Start run 1
  Run 1 DONE 
  ── 3. Failure: mixtCompLearn works in hierarchicalMode (@test.runWrapper.R#510) 
  norm(getTik(resPredict, log = FALSE) - getEmpiricTik(resPredict))/resPredict$algo$nInd is not less than 0.1. Difference: 0.07
  
  $warnLog
  [1] "Crash."
  
  ====== Run MixtComp in learn mode with 1 run(s) per number of classes and 1 core(s)
  Data: 200 individuals and 8 variables.
  -- K = 2
  Start run 1
  double free or corruption (out)