Running ‘LTS-specials.R’ [0s/1s]
  Running ‘MCD-specials.R’ [0s/1s]
  Comparing ‘MCD-specials.Rout’ to ‘MCD-specials.Rout.save’ ... OK
  Running ‘MT-tst.R’ [7s/10s]
  Running ‘NAcoef.R’ [2s/3s]
  Comparing ‘NAcoef.Rout’ to ‘NAcoef.Rout.save’ ... OK
  Running ‘OGK-ex.R’ [1s/1s]
  Comparing ‘OGK-ex.Rout’ to ‘OGK-ex.Rout.save’ ... OK
  Running ‘Rsquared.R’ [1s/1s]
  Comparing ‘Rsquared.Rout’ to ‘Rsquared.Rout.save’ ... OK
  Running ‘binom-ni-small.R’ [0s/1s]
  Comparing ‘binom-ni-small.Rout’ to ‘binom-ni-small.Rout.save’ ... OK
  Running ‘binom-no-x.R’ [0s/1s]
  Running ‘comedian-tst.R’ [2s/2s]
  Running ‘exact-fit-categorical.R’ [0s/1s]
  Running ‘glmrob-1.R’ [9s/12s]
  Running ‘glmrob-specials.R’ [0s/1s]
  Running ‘huber-etc.R’ [0s/1s]
  Comparing ‘huber-etc.Rout’ to ‘huber-etc.Rout.save’ ... OK
  Running ‘lmrob-data.R’ [14s/19s]
  Running ‘lmrob-ex12.R’ [4s/5s]
  Running ‘lmrob-methods.R’ [1s/1s]
  Comparing ‘lmrob-methods.Rout’ to ‘lmrob-methods.Rout.save’ ... OK
  Running ‘lmrob-outlierStats.R’ [1s/2s]
  Running ‘lmrob-psifns.R’ [4s/6s]
  Comparing ‘lmrob-psifns.Rout’ to ‘lmrob-psifns.Rout.save’ ... OK
  Running ‘m-s-estimator.R’ [3s/4s]
  Running ‘mc-etc.R’ [1s/1s]
  Running ‘mc-strict.R’ [4s/6s]
  Running ‘nlregrob-tst.R’ [22s/30s]
  Running ‘nlrob-tst.R’ [3s/5s]
  Running ‘plot-ex.R’ [1s/1s]
  Running ‘poisson-ex.R’ [2s/3s]
  Running ‘psi-rho-etc.R’ [1s/1s]
  Comparing ‘psi-rho-etc.Rout’ to ‘psi-rho-etc.Rout.save’ ... OK
  Running ‘small-sample.R’ [7s/8s]
  Comparing ‘small-sample.Rout’ to ‘small-sample.Rout.save’ ... OK
  Running ‘subsample.R’ [4s/6s]
  Running ‘tlts.R’ [1s/1s]
  Comparing ‘tlts.Rout’ to ‘tlts.Rout.save’ ... OK
  Running ‘tmcd.R’ [8s/11s]
  Running ‘weights.R’ [1s/2s]
  Comparing ‘weights.Rout’ to ‘weights.Rout.save’ ... OK
  Running ‘wgt-himed-xtra.R’ [3s/5s]
  Running ‘wgt-himed.R’ [0s/1s]
  Comparing ‘wgt-himed.Rout’ to ‘wgt-himed.Rout.save’ ... OK
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(/home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/robustbase/xtraR/mcnaive.R):
  source(/home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/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 8
   $ sizeof.longlong  : int 8
   $ sizeof.longdouble: int 16
   $ sizeof.pointer   : int 8
  64 bit platform type 'unix'  ==> onWindows: FALSE
  arch: x86_64
  osVersion (0): Debian GNU/Linux buster/sid 
  osVersion: Debian GNU/Linux buster/sid |  BLAS "is" Lapack: FALSE 
  strictR: TRUE 
  > 
  > (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.037 0 0.037 0 0 
  > DO(0 == sapply(n.set, function(n) mc(seq_len(n), doRefl=FALSE)))
  Time elapsed:  0.035 0.001 0.051 0 0 
  > 
  > DO(0 == sapply(1:100, function(n) mcNaive(seq_len(n), "simple")))
  Time elapsed:  0.087 0.003 0.093 0 0 
  > DO(0 == sapply(1:100, function(n) mcNaive(seq_len(n), "h.use" )))
  Time elapsed:  0.026 0 0.058 0 0 
  > 
  > 
  > x1 <- c(1, 2, 7, 9, 10)
  > mcNaive(x1) # = -1/3
  [1] -0.3333333
  > assertEQm12(-1/3, mcNaive(x1))
  > 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, 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.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.079 0.004 0.087 0 0 
  > set.seed(11); S.time(a1.2 <- adjOutlyingness(longley))
  Time elapsed:  0.078 0.003 0.084 0 0 
  > ##
  > set.seed(2); S.time(a2 <- adjOutlyingness(hbk))
  Time elapsed:  0.095 0.001 0.191 0 0 
  > set.seed(3); S.time(a3 <- adjOutlyingness(hbk[, 1:3]))# the 'X' space
  Time elapsed:  0.095 0 0.146 0 0 
  > set.seed(4); S.time(a4 <- adjOutlyingness(milk)) # obs.63 = obs.64
  Time elapsed:  0.098 0.004 0.137 0 0 
  > set.seed(5); S.time(a5 <- adjOutlyingness(wood))
  Time elapsed:  0.08 0 0.16 0 0 
  > set.seed(6); S.time(a6 <- adjOutlyingness(wood[, 1:5]))# the 'X' space
  Time elapsed:  0.076 0 0.082 0 0 
  > 
  > ## 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(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, 30, 
  33, 6, 32, 35, 31, 34, 43, 29, 58, 64, 52, 39, 63, 45, 36, 57, 
  46, 42, 44, 25, 54, 11, 1, 9, 2, 71, 14, 75, 21, 4, 10, 23, 24, 
  16, 22, 15, 20, 38, 72, 41, 12, 50, 60, 62, 26, 69, 17, 5, 28, 
  7, 49, 13, 40, 59, 18)
  > 
  > (i.a4Out <- which(!a4$nonOut)) # varies "wildly"
   [1]  9 10 11 12 13 14 15 16 17 18 19 23 24 25 26 27 57 59 70 77
  > {
  +     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))
  + }
  [1] TRUE
  > 
  > ## 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
  [1]  3 20
  > 
  > 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
  + })
  Error: { .... is not TRUE
  Execution halted