Running 'LTS-specials.R' [1s]
  Running 'MCD-specials.R' [1s]
  Comparing 'MCD-specials.Rout' to 'MCD-specials.Rout.save' ... OK
  Running 'MT-tst.R' [10s]
  Running 'NAcoef.R' [3s]
  Comparing 'NAcoef.Rout' to 'NAcoef.Rout.save' ... OK
  Running 'OGK-ex.R' [1s]
  Comparing 'OGK-ex.Rout' to 'OGK-ex.Rout.save' ... OK
  Running 'Qn-Sn-plots.R' [1s]
  Running 'Rsquared.R' [1s]
  Comparing 'Rsquared.Rout' to 'Rsquared.Rout.save' ... OK
  Running 'binom-ni-small.R' [1s]
  Comparing 'binom-ni-small.Rout' to 'binom-ni-small.Rout.save' ... OK
  Running 'binom-no-x.R' [1s]
  Running 'comedian-tst.R' [3s]
  Running 'exact-fit-categorical.R' [1s]
  Running 'glmrob-1.R' [14s]
  Running 'glmrob-specials.R' [1s]
  Running 'huber-etc.R' [0s]
  Comparing 'huber-etc.Rout' to 'huber-etc.Rout.save' ... OK
  Running 'large-values.R' [1s]
  Running 'lmrob-data.R' [6s]
  Running 'lmrob-ex12.R' [5s]
  Running 'lmrob-methods.R' [1s]
  Comparing 'lmrob-methods.Rout' to 'lmrob-methods.Rout.save' ... OK
  Running 'lmrob-psifns.R' [5s]
  Comparing 'lmrob-psifns.Rout' to 'lmrob-psifns.Rout.save' ... OK
  Running 'm-s-estimator.R' [4s]
  Running 'mc-etc.R' [1s]
  Running 'mc-strict.R' [8s]
  Running 'nlregrob-tst.R' [21s]
  Running 'nlrob-tst.R' [4s]
  Running 'poisson-ex.R' [2s]
  Running 'psi-rho-etc.R' [1s]
  Comparing 'psi-rho-etc.Rout' to 'psi-rho-etc.Rout.save' ... OK
  Running 'small-sample.R' [10s]
  Comparing 'small-sample.Rout' to 'small-sample.Rout.save' ... OK
  Running 'subsample.R' [8s]
  Running 'tlts.R' [1s]
  Comparing 'tlts.Rout' to 'tlts.Rout.save' ... OK
  Running 'tmcd.R' [12s]
  Running 'weights.R' [1s]
  Comparing 'weights.Rout' to 'weights.Rout.save' ...442,443c442,443
< Warning message:
< In lf.cov(object, complete = complete, ...) :
---
> Warning messages:
> 1: In lf.cov(object, complete = complete, ...) :
444a445,446
> 2: In lf.cov(object, complete = complete, ...) :
>   .vcov.avar1: negative diag(<vcov>) fixed up; consider 'cov=".vcov.w."' instead
  Running 'wgt-himed-xtra.R' [4s]
  Running 'wgt-himed.R' [1s]
  Comparing 'wgt-himed.Rout' to 'wgt-himed.Rout.save' ...12,14d11
< > stopifnot(is.na(wgt.himedian(numeric())))
< > ## hi-median(<empty>)  seg.faulted or inf.looped till Jan.3, 2021
< > 
Running the tests in 'tests/mc-strict.R' failed.
Complete output:
  > 
  > #### Testing  medcouple mc() and related functions
  > 
  > ### here, we do "strict tests" -- hence no *.Rout.save
  > ### hence, can also produce non-reproducible output such as timing
  > 
  > library(robustbase)
  > for(f in system.file("xtraR", c("mcnaive.R", # -> mcNaive()
  + 			      "platform-sessionInfo.R"),
  +                      package = "robustbase", mustWork=TRUE)) {
  +     cat("source(",f,"):\n", sep="")
  +     source(f)
  + }
  source(D:/temp/RtmpojTafZ/RLIBS_10520d21635/robustbase/xtraR/mcnaive.R):
  source(D:/temp/RtmpojTafZ/RLIBS_10520d21635/robustbase/xtraR/platform-sessionInfo.R):
  > source(system.file("test-tools-1.R",  package="Matrix", mustWork=TRUE))
  Loading required package: tools
  > assertEQm12 <- function(x,y, giveRE=TRUE, ...)
  +     assert.EQ(x,y, tol = 1e-12, giveRE=giveRE, ...)
  > ## ^^ shows *any* difference ("tol = 0") unless there is no difference at all
  > ##
  > c.time <- function(...) cat('Time elapsed: ', ..., '\n')
  > S.time <- function(expr) c.time(system.time(expr))
  > DO <- function(...) S.time(stopifnot(...))
  > 
  > mS <- moreSessionInfo(print.=TRUE)
  List of 4
   $ sizeof.long      : int 4
   $ sizeof.longlong  : int 8
   $ sizeof.longdouble: int 12
   $ sizeof.pointer   : int 4
  32 bit platform type 'windows'  ==> onWindows: TRUE
  arch: x86
  osVersion (0): Windows Server 2008 x64 (build 6003) Service Pack 2 
  osVersion: Windows Server 2008 x64 (build 6003) Service Pack 2 
   +  BLAS "is" Lapack: TRUE | BLAS=OpenBLAS: FALSE | Lapack=OpenBLAS: FALSE 
  strictR: FALSE 
  > 
  > (doExtras <- robustbase:::doExtras())# TRUE if interactive() or activated by envvar
  [1] FALSE
  > 
  > 
  > n.set <- c(1:99, 1e5L+ 0:1) # large n gave integer overflow in earlier versions
  > DO(0 == sapply(n.set, function(n) mc(seq_len(n))))
  Time elapsed:  0.08 0 0.08 NA NA 
  > DO(0 == sapply(n.set, function(n) mc(seq_len(n), doRefl=FALSE)))
  Time elapsed:  0.08 0 0.07 NA NA 
  > 
  > DO(0 == sapply(1:100, function(n) mcNaive(seq_len(n), "simple")))
  Time elapsed:  0.11 0 0.11 NA NA 
  > DO(0 == sapply(1:100, function(n) mcNaive(seq_len(n), "h.use" )))
  Time elapsed:  0.04 0 0.04 NA NA 
  > 
  > 
  > x1 <- c(1, 2, 7, 9, 10)
  > mcNaive(x1) # = -1/3
  [1] -0.3333333
  > assertEQm12(-1/3, mcNaive(x1, "simple"))
  > assertEQm12(-1/3, mcNaive(x1, "h.use"))
  > assertEQm12(-1/3, mc(x1))
  > 
  > x2 <- c(-1, 0, 0, 0, 1, 2)
  > mcNaive(x2, meth="simple") # = 0 - which is wrong
  [1] 0
  > mcNaive(x2, meth="h.use")  # = 1/6 = 0.16666
  [1] 0.1666667
  > assertEQm12(1/6, mc(x2))
  > assertEQm12(1/6, mcNaive(x2, "h.use"))
  > 
  > x4 <- c(1:5,7,10,15,25, 1e15) ## - bombed in orignal algo
  > mcNaive(x4,"h.use") # 0.5833333
  [1] 0.5833333
  > assertEQm12( 7/12, mcNaive(x4, "h.use"))
  > assertEQm12( 7/12, mcNaive(x4, "simple"))
  > assertEQm12( 7/12, mc( x4, doRefl= FALSE))
  > assertEQm12(-7/12, mc(-x4, doRefl= FALSE))
  > 
  > 
  > set.seed(17)
  > for(n in 3:50) {
  +     cat(" ")
  +     for(k in 1:5) {
  + 	x <- rlnorm(n)
  + 	mc1 <- mc(x)
  + 	mc2 <- mcNaive(x, method = "simple")
  + 	mc3 <- mcNaive(x, method = "h.use" )
  + 	stopifnot(all.equal(mc1, mc3, tolerance = 1e-10),# 1e-12 not quite ok
  + 		  mc2 == mc3)
  + 	cat(".")
  +     }
  + };  cat("\n")
   ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... .....
  > 
  > ###----  Strict tests of adjOutlyingness():
  > ###                      ================= changed after long-standing bug fix in Oct.2014
  > ## as this calls, sample.int() and we carefully compare specific seed examples, need
  > RNGversion("3.6.0") # == RNGversion("4.0.2") ..
  > RNGversion("3.5.0") ## [TODO: adapt to "current" RNG settings]
  Warning message:
  In RNGkind("Mersenne-Twister", "Inversion", "Rounding") :
    non-uniform 'Rounding' sampler used
  > 
  > set.seed(1);  S.time(a1.1 <- adjOutlyingness(longley))
  Time elapsed:  0.17 0 0.17 NA NA 
  > set.seed(11); S.time(a1.2 <- adjOutlyingness(longley))
  Time elapsed:  0.36 0 0.36 NA NA 
  > ##
  > set.seed(2); S.time(a2 <- adjOutlyingness(hbk))
  Time elapsed:  0.16 0 0.16 NA NA 
  > set.seed(3); S.time(a3 <- adjOutlyingness(hbk[, 1:3]))# the 'X' space
  Time elapsed:  0.17 0 0.19 NA NA 
  > set.seed(4); S.time(a4 <- adjOutlyingness(milk)) # obs.63 = obs.64
  Time elapsed:  0.19 0 0.18 NA NA 
  > set.seed(5); S.time(a5 <- adjOutlyingness(wood))
  Time elapsed:  0.15 0 0.16 NA NA 
  > set.seed(6); S.time(a6 <- adjOutlyingness(wood[, 1:5]))# the 'X' space
  Time elapsed:  0.16 0 0.15 NA NA 
  > 
  > ## 32-bit <-> 64-bit different results {tested on Linux only}
  > is32 <- .Machine$sizeof.pointer == 4 ## <- should work for Linux/MacOS/Windows
  > isMac <- Sys.info()[["sysname"]] == "Darwin"
  > isSun <- Sys.info()[["sysname"]] == "SunOS"
  > Rnk <- function(u) rank(unname(u), ties.method = "first")
  > ## to use for testing below:
  > cat("\nRnk(a3 $ adjout): "); dput(Rnk(a3$adjout), control= {})
  
  Rnk(a3 $ adjout): c(62, 64, 68, 71, 70, 65, 66, 63, 69, 67, 73, 75, 72, 74, 25, 
  52, 44, 3, 11, 33, 6, 21, 29, 28, 59, 9, 12, 13, 37, 27, 43, 
  35, 22, 55, 14, 2, 26, 46, 54, 15, 23, 41, 40, 32, 60, 30, 61, 
  19, 16, 8, 39, 53, 51, 48, 20, 47, 50, 42, 7, 38, 17, 57, 45, 
  18, 24, 34, 4, 58, 56, 5, 1, 10, 31, 36, 49)
  > cat("\nRnk(a4 $ adjout): "); dput(Rnk(a4$adjout), control= {})
  
  Rnk(a4 $ adjout): c(84, 85, 80, 70, 56, 64, 26, 45, 57, 16, 52, 78, 73, 79, 76, 
  75, 68, 61, 58, 69, 34, 3, 7, 10, 22, 12, 62, 66, 59, 9, 35, 
  39, 6, 38, 30, 37, 42, 46, 19, 72, 83, 65, 48, 82, 44, 31, 71, 
  55, 51, 53, 32, 67, 14, 1, 11, 2, 36, 18, 43, 28, 4, 13, 40, 
  41, 23, 29, 20, 27, 47, 86, 50, 15, 63, 77, 81, 33, 54, 24, 5, 
  25, 8, 60, 17, 49, 74, 21)
  > 
  > (i.a4Out <- which(!a4$nonOut)) # varies "wildly"
  [1] 70
  > {
  +     if(is32 && !isMac)
  +         all.equal(i.a4Out, c(1, 2, 41, 70))
  +     ## and this is "typically" true, but not for a 64-bit Linux version bypassing BLAS in matprod
  +     else if(isSun || isMac)
  +         TRUE
  +     else
  +         all.equal(i.a4Out, c(9:19, 23:27,57, 59, 70, 77)) # '70' only 64b-Fedora_32, Dec.2020
  + }
  [1] "Numeric: lengths (1, 4) differ"
  > 
  > ## only for ATLAS (BLAS/Lapack), not all are TRUE; which ones?
  > if(!all(a5$nonOut))
  +   print(which(!a5$nonOut)) # if we know, enable check below
  > 
  > stopifnot(exprs = {
  +     which(!a2$nonOut) == 1:14
  +     which(!a3$nonOut) == 1:14
  +     ## 'longley', 'wood' have no outliers in the "adjOut" sense:
  +     ## FIXME: longley is platform dependent too
  +     { if(isMac) TRUE
  +       else if(mS$ strictR) sum(a1.2$nonOut) >= 15 # sum(.) = 16 [nb-mm3, Oct.2014]
  +       else ## however, openBLAS Fedora Linux /usr/bin/R gives sum(a1.2$nonOut) = 13
  +           sum(a1.2$nonOut) >= 13
  +     }
  +     if(doExtras) {
  +         if(mS$ strictR) a5$nonOut
  +         else ## not for ATLAS
  +             sum(a5$nonOut) >= 18 # 18: OpenBLAS
  +     } else TRUE
  +     a6$nonOut[-20]
  +     ## hbk (n = 75) :
  +     abs(Rnk(a3$adjout) -
  +              c(62, 64, 68, 71, 70,   65, 66, 63, 69, 67,   73, 75, 72, 74, 25,
  +                52, 44,  5, 11, 33,    6, 21, 29, 28, 59,    9, 12, 13, 37, 27,
  +                43, 35, 22, 55, 14,    2, 26, 46, 54, 15,   23, 41, 40, 32, 60,
  +                30, 61, 19, 16,  8,   39, 53, 51, 48, 20,   47, 50, 42,  7, 38,
  +                17, 57, 45, 18, 24,   34,  3, 58, 56,  4,    1, 10, 31, 36, 49)
  + 	      ) <= 3 ## all 0 on 32-bit Linux
  + })
  > 
  > ## milk (n = 86) : -- Quite platform dependent!
  > r <- Rnk(a4$adjout)
  > r64 <- ## the 64-bit (ubuntu 14.04, nb-mm3) values:
  +     c(65, 66, 61, 56, 47,   51, 19, 37, 74, 67,   79, 86, 83, 84, 85,
  +       82, 81, 73, 80, 55,   27,  3, 70, 68, 78,   76, 77, 53, 48,  8,
  +       29, 33,	 6, 32, 28,   31, 36, 40, 22, 58,   64, 52, 39, 63, 44,
  +       30, 57, 46, 43, 45,   25, 54, 12,  1,  9,    2, 71, 14, 75, 23,
  +       4, 10, 34, 35, 17,   24, 15, 20, 38, 72,   42, 13, 50, 60, 62,
  +       26, 69, 18,  5, 21,    7, 49, 11, 41, 59,   16)
  > r32 <- ## Linux 32bit (florence: 3.14.8-100.fc19.i686.PAE)
  +     c(78, 79, 72, 66, 52,   61, 22, 41, 53, 14,   74, 85, 82, 83, 84,
  +       80, 81, 56, 73, 65,   30,  3, 16, 17, 68,   57, 58, 63, 54,  8,
  +       32, 37,  6, 36, 31,   35, 40, 44, 25, 69,   77, 62, 43, 76, 48,
  +       34, 67, 51, 47, 49,   28, 64, 12,  1,  9,    2, 33, 15, 59, 26,
  +       4, 10, 38, 39, 20,   27, 18, 23, 42, 86,   46, 13, 60, 71, 75,
  +       29, 50, 21,  5, 24,    7, 55, 11, 45, 70,   19)
  > d <- (r - if (is32) r32 else r64)
  > cbind(r, d)
         r   d
   [1,] 84   6
   [2,] 85   6
   [3,] 80   8
   [4,] 70   4
   [5,] 56   4
   [6,] 64   3
   [7,] 26   4
   [8,] 45   4
   [9,] 57   4
  [10,] 16   2
  [11,] 52 -22
  [12,] 78  -7
  [13,] 73  -9
  [14,] 79  -4
  [15,] 76  -8
  [16,] 75  -5
  [17,] 68 -13
  [18,] 61   5
  [19,] 58 -15
  [20,] 69   4
  [21,] 34   4
  [22,]  3   0
  [23,]  7  -9
  [24,] 10  -7
  [25,] 22 -46
  [26,] 12 -45
  [27,] 62   4
  [28,] 66   3
  [29,] 59   5
  [30,]  9   1
  [31,] 35   3
  [32,] 39   2
  [33,]  6   0
  [34,] 38   2
  [35,] 30  -1
  [36,] 37   2
  [37,] 42   2
  [38,] 46   2
  [39,] 19  -6
  [40,] 72   3
  [41,] 83   6
  [42,] 65   3
  [43,] 48   5
  [44,] 82   6
  [45,] 44  -4
  [46,] 31  -3
  [47,] 71   4
  [48,] 55   4
  [49,] 51   4
  [50,] 53   4
  [51,] 32   4
  [52,] 67   3
  [53,] 14   2
  [54,]  1   0
  [55,] 11   2
  [56,]  2   0
  [57,] 36   3
  [58,] 18   3
  [59,] 43 -16
  [60,] 28   2
  [61,]  4   0
  [62,] 13   3
  [63,] 40   2
  [64,] 41   2
  [65,] 23   3
  [66,] 29   2
  [67,] 20   2
  [68,] 27   4
  [69,] 47   5
  [70,] 86   0
  [71,] 50   4
  [72,] 15   2
  [73,] 63   3
  [74,] 77   6
  [75,] 81   6
  [76,] 33   4
  [77,] 54   4
  [78,] 24   3
  [79,]  5   0
  [80,] 25   1
  [81,]  8   1
  [82,] 60   5
  [83,] 17   6
  [84,] 49   4
  [85,] 74   4
  [86,] 21   2
  >        table(abs(d))
  
   0  1  2  3  4  5  6  7  8  9 13 15 16 22 45 46 
   7  4 15 13 21  6  8  2  2  2  1  1  1  1  1  1 
  > cumsum(table(abs(d))) # <=> unscaled ecdf(d)
   0  1  2  3  4  5  6  7  8  9 13 15 16 22 45 46 
   7 11 26 39 60 66 74 76 78 80 81 82 83 84 85 86 
  > 
  > ## For the biggest part (79 out of 86), the ranks are "close":
  > ## 2014: still true, but in a different sense..
  > ##       ^ typically, but e.g., *not* when using non-BLAS matprod():
  > sum(abs(d) <= 17) >= 78
  [1] TRUE
  > sum(abs(d) <= 13) >= 75
  [1] TRUE
  > 
  > 
  > RNGversion("3.6.0") # == RNGversion("4.0.2") ..
  > 
  > ## check of adjOutlyingness *free* bug
  > ## reported by Kaveh Vakili <Kaveh.Vakili@wis.kuleuven.be>
  > set.seed(-37665251)
  > X <- matrix(rnorm(100*5),100,5)
  > Z <- matrix(rnorm(100*5,0,1/100),10,5)
  > Z <- sweep(Z, 2, c(5,rep(0,4)), FUN="+")
  > X[91:100,] <- Z
  > for (i in 1:10) {
  +     ## this would produce an error in the 6th iteration
  +     aa <- adjOutlyingness(x=X,ndir=250)
  + }
  > 
  > ## Check "high"-dimensional Noise ... typically mc() did *not* converge for some re-centered columns
  > ## Example by Valentin Todorov:
  > n <- 50
  > p <- 30
  > set.seed(1) # MM
  > a <- matrix(rnorm(n * p), nrow=n, ncol=p)
  > str(a)
   num [1:50, 1:30] -0.626 0.184 -0.836 1.595 0.33 ...
  > kappa(a) # 20.42 (~ 10--20 or so; definitely not close to singular)
  [1] 20.42296
  > a.a <- adjOutlyingness(a, mcScale=FALSE, # <- my own recommendation
  +                        trace.lev=1)
  keeping *all*  250  normalized directions
  med <- colMedians(Y):  250  values; summary():
      Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
  0.002157 0.052337 0.106917 0.128326 0.175055 0.582199 
  Columnwise mc() got  250  values; summary():
      Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
  -1.00000 -0.35003 -0.08430 -0.12565  0.09606  1.00000 
  250 lower & upper Y (:= X - med(.)) values:
       Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
  0.0000000 0.0000000 0.0000000 0.2340537 0.0000841 2.9154090 
     Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  0.00000 0.00000 0.00000 0.07054 0.00000 2.69953 
  outlyingnesses for all directions (of which max(.) will be chosen:
            0%          25%          50%          75%         100% 
  0.000000e+00 1.749008e-01 5.558390e-01 3.425042e+14 1.354116e+16 
  > a.s <- adjOutlyingness(a, mcScale=TRUE, trace.lev=1)
  keeping *all*  250  normalized directions
  med <- colMedians(Y):  250  values; summary():
       Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
  0.0006641 0.0700928 0.1242860 0.1483769 0.2124847 0.5023069 
  Columnwise mc() got  250  values; summary():
      Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
  -1.00000 -0.61958 -0.15346 -0.20492  0.07268  1.00000 
  250 lower & upper Y (:= X - med(.)) values:
     Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  0.00000 0.00000 0.00000 0.39893 0.09289 3.43848 
     Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  0.00000 0.00000 0.00000 0.09298 0.00000 3.08440 
  outlyingnesses for all directions (of which max(.) will be chosen:
            0%          25%          50%          75%         100% 
  0.000000e+00 1.702128e-01 5.454545e-01 3.598388e+14 1.397720e+16 
  > 
  > str(a.a) # surprisingly high 'adjout' values "all similar" -> no outliers .. hmm .. ???
  List of 7
   $ adjout      : num [1:50] 3.77e+15 4.83e+15 1.35e+16 8.29e+15 6.94e+15 ...
   $ iter        : int 250
   $ ndir.final  : int 250
   $ MCadjout    : num 0.15
   $ Qalph.adjout: Named num [1:2] 4.49e+15 7.25e+15
    ..- attr(*, "names")= chr [1:2] "25%" "75%"
   $ cutoff      : Named num 1.38e+16
    ..- attr(*, "names")= chr "75%"
   $ nonOut      : logi [1:50] TRUE TRUE TRUE TRUE TRUE TRUE ...
  > stopifnot(exprs = {
  +     ## a.a :
  +     identical(a.a$nonOut, local({r <- rep(TRUE, 50); r[22] <- FALSE; r}))
  +     all.equal(a.a$MCadjout, 0.136839766177, tol = 1e-12) # seen 7.65e-14
  +     ## a.s :
  +     a.s$nonOut # all TRUE
  +     all.equal(a.s$MCadjout, 0.32284906741568, tol = 1e-13) # seen 2.2e-15
  + })
  Error: identical(a.a$nonOut, local({ .... is not TRUE
  Execution halted