Running 'L1med-tst.R' [1s]
  Running 'cov-ex.R' [154s]
Running the tests in 'tests/cov-ex.R' failed.
Complete output:
  > library(robustX)
  > library(robustbase)
  > (newRB <- (packageVersion("robustbase") >= "0.99"))
  [1] TRUE
  > 
  > sessionInfo()
  R Under development (unstable) (2024-03-22 r86169 ucrt)
  Platform: x86_64-w64-mingw32/x64
  Running under: Windows Server 2022 x64 (build 20348)
  
  Matrix products: default
  
  
  locale:
  [1] LC_COLLATE=C                 LC_CTYPE=German_Germany.utf8
  [3] LC_MONETARY=C                LC_NUMERIC=C                
  [5] LC_TIME=C                   
  
  time zone: Europe/Berlin
  tzcode source: internal
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  other attached packages:
  [1] robustbase_0.99-2 robustX_1.2-7    
  
  loaded via a namespace (and not attached):
  [1] DEoptimR_1.1-3 compiler_4.4.0
  > packageDescription("robustX")
  Package: robustX
  Type: Package
  Title: 'eXtra' / 'eXperimental' Functionality for Robust Statistics
  Version: 1.2-7
  Date: 2023-06-14
  Authors@R: c(person("Martin","Maechler", role=c("aut","cre"),
          email="maechler@stat.math.ethz.ch", comment = c(ORCID =
          "0000-0002-8685-9910")) , person("Werner A.", "Stahel",
          role="aut", email="stahel@stat.math.ethz.ch") , person("Rolf",
          "Turner", role="ctb", email="r.turner@auckland.ac.nz", comment
          = "reclas()") , person("Ueli", "Oetliker", role="ctb", comment
          = "original version of BACON() and mvBACON for S+") ,
          person("Tobias", "Schoch", role="ctb", comment =
          "init.sel=\"V2\" for BACON; fix alpha") )
  Maintainer: Martin Maechler <maechler@stat.math.ethz.ch>
  Description: Robustness -- 'eXperimental', 'eXtraneous', or
          'eXtraordinary' Functionality for Robust Statistics.  Hence
          methods which are not well established, often related to
          methods in package 'robustbase'.  Amazingly, 'BACON()',
          originally by Billor, Hadi, and Velleman (2000)
          <doi:10.1016/S0167-9473(99)00101-2> has become established in
          places.  The "barrow wheel" `rbwheel()` is from Stahel and
          Mächler (2009) <doi:10.1111/j.1467-9868.2009.00706.x>.
  Imports: grDevices, graphics, stats, utils, robustbase (>= 0.92-3)
  Suggests: MASS, lattice, pcaPP
  Enhances: ICS
  License: GPL (>= 2)
  Encoding: UTF-8
  NeedsCompilation: no
  Packaged: 2023-06-14 21:41:58 UTC; maechler
  Author: Martin Maechler [aut, cre]
          (<https://orcid.org/0000-0002-8685-9910>), Werner A. Stahel
          [aut], Rolf Turner [ctb] (reclas()), Ueli Oetliker [ctb]
          (original version of BACON() and mvBACON for S+), Tobias Schoch
          [ctb] (init.sel="V2" for BACON; fix alpha)
  Repository: CRAN
  Date/Publication: 2023-06-16 07:30:02 UTC
  Built: R 4.4.0; ; 2024-03-23 02:56:07 UTC; windows
  
  -- File: D:/RCompile/CRANpkg/lib/4.4/robustX/Meta/package.rds 
  > (ourBLAS <- grepl(print(normalizePath(R.home())),
  +                         normalizePath(extSoftVersion()[["BLAS"]]), fixed = TRUE))
  [1] "D:\\RCompile\\recent\\R"
  [1] FALSE
  Warning message:
  In normalizePath(path.expand(path), winslash, mustWork) :
    path[1]="": Das System kann den angegebenen Pfad nicht finden
  > ## need extended precision (typically *includes* 64-bit):
  > doCheck <- (.Machine$sizeof.longdouble >= 16)
  > cat("doCheck (= have long double):", doCheck,"\n")
  doCheck (= have long double): TRUE 
  > 
  > if(!dev.interactive(orNone=TRUE)) pdf("cov-ex.pdf")
  > 
  > covNN.1 <- robustX:::covNNC1  ## the original definition (2003)
  > 
  > data(iris)
  > system.time(cN1 <- covNN.1(iris[-5]))
     user  system elapsed 
     0.17    0.01    0.19 
  > system.time(cN  <- covNNC (iris[-5]))# faster indeed
     user  system elapsed 
     0.08    0.00    0.08 
  > 
  > ## report.and.stop.if.not.all.equal
  > report.stopifnot.all.eq <- function(a,b, tol, ...) {
  +     call <- sys.call()
  +     ae <- all.equal(a,b, tol=tol, ...)
  +     call[[1]] <- quote(all.equal)
  +     if(!isTRUE(ae))
  + 	stop(sprintf("Not %s:\n%s\n\n", deparse(call),
  + 		     paste(ae, collapse="\n")),
  + 	     call.=FALSE)
  +     ## else
  +     TRUE
  + }
  > 
  > UN <- function(L) lapply(L, unname)
  > 
  > chk.NN.new.old <- function(cNew, cNold, tol = 2e-15, tol.1 = 20*tol) {
  +     stopifnot(is.list(cNold$innc), length(n.i <- names(cNold$innc)) == 4)
  +     cat("classification accordance matrix:\n")
  +     print(table(new = cNew $classification,
  +                 old = cNold$classification))
  +     report.stopifnot.all.eq(UN(cNew [1:4]),
  +                             UN(cNold[1:4]), tol=tol.1) &
  +     report.stopifnot.all.eq(cNew $innc[n.i],
  +                             cNold$innc[n.i], tol=tol)
  + }
  > 
  > summ.NN <- function(cNN, digits = 3) {
  +     cbind(class = cNN$classification,
  +           pprob = round(cNN$postprob, digits),
  +           incc.p= round(cNN$innc$postprob, digits))
  + }
  > 
  > s1 <- summ.NN(cN1)
  > ss <- summ.NN(cN)
  > if(isTRUE(all.equal(ss, s1))) ss else cbind(ss, s1)
         class pprob incc.p
    [1,]     1 1.000  1.000
    [2,]     1 1.000  1.000
    [3,]     1 1.000  1.000
    [4,]     1 1.000  1.000
    [5,]     1 1.000  1.000
    [6,]     1 1.000  0.171
    [7,]     1 1.000  1.000
    [8,]     1 1.000  1.000
    [9,]     1 1.000  1.000
   [10,]     1 1.000  1.000
   [11,]     1 1.000  1.000
   [12,]     1 1.000  1.000
   [13,]     1 1.000  1.000
   [14,]     1 1.000  1.000
   [15,]     1 0.998  0.000
   [16,]     0 0.000  0.000
   [17,]     1 1.000  0.718
   [18,]     1 1.000  1.000
   [19,]     1 1.000  0.002
   [20,]     1 1.000  1.000
   [21,]     1 1.000  1.000
   [22,]     1 1.000  1.000
   [23,]     1 1.000  1.000
   [24,]     1 1.000  1.000
   [25,]     1 1.000  1.000
   [26,]     1 1.000  1.000
   [27,]     1 1.000  1.000
   [28,]     1 1.000  1.000
   [29,]     1 1.000  1.000
   [30,]     1 1.000  1.000
   [31,]     1 1.000  1.000
   [32,]     1 1.000  1.000
   [33,]     1 1.000  0.000
   [34,]     0 0.000  0.000
   [35,]     1 1.000  1.000
   [36,]     1 1.000  1.000
   [37,]     1 1.000  1.000
   [38,]     1 1.000  1.000
   [39,]     1 1.000  1.000
   [40,]     1 1.000  1.000
   [41,]     1 1.000  1.000
   [42,]     0 0.000  0.000
   [43,]     1 1.000  1.000
   [44,]     1 1.000  1.000
   [45,]     1 1.000  1.000
   [46,]     1 1.000  1.000
   [47,]     1 1.000  1.000
   [48,]     1 1.000  1.000
   [49,]     1 1.000  1.000
   [50,]     1 1.000  1.000
   [51,]     1 1.000  0.058
   [52,]     1 1.000  1.000
   [53,]     1 1.000  1.000
   [54,]     1 1.000  0.773
   [55,]     1 1.000  1.000
   [56,]     1 1.000  1.000
   [57,]     1 1.000  0.999
   [58,]     1 1.000  0.000
   [59,]     1 1.000  1.000
   [60,]     1 1.000  1.000
   [61,]     0 0.000  0.000
   [62,]     1 1.000  1.000
   [63,]     0 0.000  0.000
   [64,]     1 1.000  1.000
   [65,]     1 1.000  1.000
   [66,]     1 1.000  1.000
   [67,]     1 1.000  1.000
   [68,]     1 1.000  1.000
   [69,]     0 0.000  0.000
   [70,]     1 1.000  1.000
   [71,]     1 1.000  1.000
   [72,]     1 1.000  1.000
   [73,]     1 1.000  1.000
   [74,]     1 1.000  1.000
   [75,]     1 1.000  1.000
   [76,]     1 1.000  1.000
   [77,]     1 1.000  1.000
   [78,]     1 1.000  1.000
   [79,]     1 1.000  1.000
   [80,]     1 1.000  1.000
   [81,]     1 1.000  1.000
   [82,]     1 1.000  0.999
   [83,]     1 1.000  1.000
   [84,]     1 1.000  1.000
   [85,]     1 1.000  1.000
   [86,]     1 1.000  0.000
   [87,]     1 1.000  1.000
   [88,]     1 1.000  0.000
   [89,]     1 1.000  1.000
   [90,]     1 1.000  1.000
   [91,]     1 1.000  1.000
   [92,]     1 1.000  1.000
   [93,]     1 1.000  1.000
   [94,]     0 0.001  0.000
   [95,]     1 1.000  1.000
   [96,]     1 1.000  1.000
   [97,]     1 1.000  1.000
   [98,]     1 1.000  1.000
   [99,]     1 1.000  0.000
  [100,]     1 1.000  1.000
  [101,]     1 1.000  0.000
  [102,]     1 1.000  1.000
  [103,]     1 1.000  1.000
  [104,]     1 1.000  1.000
  [105,]     1 1.000  1.000
  [106,]     1 0.998  0.000
  [107,]     0 0.317  0.000
  [108,]     1 1.000  0.000
  [109,]     1 0.999  0.000
  [110,]     0 0.000  0.000
  [111,]     1 1.000  1.000
  [112,]     1 1.000  1.000
  [113,]     1 1.000  1.000
  [114,]     1 1.000  0.000
  [115,]     1 1.000  0.899
  [116,]     1 1.000  1.000
  [117,]     1 1.000  1.000
  [118,]     0 0.000  0.000
  [119,]     0 0.000  0.000
  [120,]     0 0.000  0.000
  [121,]     1 1.000  1.000
  [122,]     1 1.000  1.000
  [123,]     0 0.000  0.000
  [124,]     1 1.000  1.000
  [125,]     1 1.000  1.000
  [126,]     1 1.000  0.229
  [127,]     1 1.000  1.000
  [128,]     1 1.000  1.000
  [129,]     1 1.000  1.000
  [130,]     1 1.000  0.702
  [131,]     0 0.357  0.000
  [132,]     0 0.000  0.000
  [133,]     1 1.000  1.000
  [134,]     1 1.000  1.000
  [135,]     1 1.000  0.818
  [136,]     1 0.999  0.000
  [137,]     1 1.000  0.000
  [138,]     1 1.000  1.000
  [139,]     1 1.000  1.000
  [140,]     1 1.000  1.000
  [141,]     1 1.000  1.000
  [142,]     1 1.000  1.000
  [143,]     1 1.000  1.000
  [144,]     1 1.000  1.000
  [145,]     1 1.000  1.000
  [146,]     1 1.000  1.000
  [147,]     1 1.000  0.991
  [148,]     1 1.000  1.000
  [149,]     1 1.000  0.000
  [150,]     1 1.000  1.000
  > 
  > 
  > try( # testing (tol=0 too small)
  +     chk.NN.new.old(cN, cN1, tol=0)
  + )
  classification accordance matrix:
     old
  new   0   1
    0  15   0
    1   0 135
  Error : Not all.equal(UN(cNew[1:4]), UN(cNold[1:4]), tol = tol.1):
  Component "cov": Mean relative difference: 1.027105e-15
  Component "mu": Mean relative difference: 4.206611e-16
  Component "postprob": Mean relative difference: 2.182394e-14
  
  
  > ## This used to fail when we use R's instead of BLAS matrix products:
  > if(doCheck)
  +     chk.NN.new.old(cN, cN1, tol = 4e-15) # seen 1.1e-15 work
  classification accordance matrix:
     old
  new   0   1
    0  15   0
    1   0 135
  [1] TRUE
  > 
  > 
  > ## for n = 500, you *do* see it
  > n <- 500
  > set.seed(12)
  > X <- rbwheel(n, 7, spherize=TRUE)
  > 
  > lattice::splom(X, cex=.1)
  > system.time(cNX1 <- covNN.1(X))# 0.82  0.273
     user  system elapsed 
     0.53    0.08    0.60 
  > system.time(cNX  <- covNNC (X))# 0.66  0.163
     user  system elapsed 
     0.34    0.03    0.37 
  > system.time(cM   <- covMcd (X))# 0.151 0.097  <- !
     user  system elapsed 
     0.12    0.00    0.13 
  > # NB: *slower* times above, when using R's instead of BLAS matrix prod
  > 
  > try( # --> show relative difference(s):
  +     chk.NN.new.old(cNX, cNX1, tol=0)
  + )
  classification accordance matrix:
     old
  new   0   1
    0 180   0
    1   0 320
  Error : Not all.equal(UN(cNew[1:4]), UN(cNold[1:4]), tol = tol.1):
  Component "cov": Mean relative difference: 3.701093e-15
  Component "mu": Mean relative difference: 1.637949e-14
  Component "postprob": Mean relative difference: 7.201937e-15
  
  
  > if(doCheck && ourBLAS) # did fail with ATLAS in R-devel 2023-1-1
  +     chk.NN.new.old(cNX, cNX1)
  > 
  > stopifnot(exprs = {
  +     all.equal(1900.4208,   kappa(cM $cov))# 1990.8.. then  1900.421
  +     all.equal(4.485807117, kappa(cNX$cov))
  +     all.equal(1.047781251, kappa(cov(X)))
  + })
  > 
  > ## ---- d = 1 :
  > X1 <- cbind(c(1:6, 1000))
  > 
  > var(X1)
           [,1]
  [1,] 141861.8
  > ##          [,1]
  > ## [1,] 141861.8
  > ## if 1000 was not an outlier:
  > var(1:7) ## 4.666667
  [1] 4.666667
  > 
  > covNNC(X1)$cov ## -- really not at all robust:
           [,1]
  [1,] 121595.8
  > ##          [,1]
  > ## [1,] 121595.8
  > 
  > (C.mcd <- covMcd(X1)$cov)
           [,1]
  [1,] 4.884832
  > Cm <- as.matrix(if(newRB) 4.8848 else 7.790004)
  > all.equal(Cm, C.mcd, tol=0) # 6.633e-6
  [1] "Mean relative difference: 6.633081e-06"
  > stopifnot(all.equal(Cm, C.mcd, tol = 2e-5))
  > 
  > 
  > MASS::cov.rob(X1)$cov
       [,1]
  [1,]  3.5
  > ##      [,1]
  > ## [1,]  3.5
  > (C.B <- BACON(X1)$cov)
  rank(x.ord[1:m,] >= p  ==> chosen m =  3 
  MV-BACON (subset no. 1): 3 of 7 (42.86 %)
  MV-BACON (subset no. 2): 6 of 7 (85.71 %)
  MV-BACON (subset no. 3): 6 of 7 (85.71 %)
       [,1]
  [1,]  3.5
  > ##      [,1]
  > ## [1,]  3.5
  > all.equal(C.B, as.matrix(3.5), tol=0)
  [1] TRUE
  > stopifnot(all.equal(C.B, as.matrix(3.5)))
  > 
  > if(FALSE) ## FIXME (in robustbase!): should work for  p=1
  +     covOGK(X1)$cov
  > 
  > 
  > ## Less trivial data  --- also used in ../man/BACON.Rd
  > data(starsCYG, package = "robustbase")
  > 
  > op <- options(warn = 2)# no warnings allowed
  > str(B.ST <- with(starsCYG, BACON(x = log.Te, y = log.light)))
  rank(x.ord[1:m,] >= p  ==> chosen m =  4 
  MV-BACON (subset no. 1): 4 of 47 (8.51 %)
  MV-BACON (subset no. 2): 5 of 47 (10.64 %)
  MV-BACON (subset no. 3): 5 of 47 (10.64 %)
  Reg-BACON (init subset no. 0): 8 of 47 (17.02 %)
  Reg-BACON (init subset no. 0): 3 of 47 (6.38 %)
  Reg-BACON (init subset no. 1): 4 of 47 (8.51 %)
  Reg-BACON (init subset no. 2): 5 of 47 (10.64 %)
  Reg-BACON (init subset no. 3): 6 of 47 (12.77 %)
  Reg-BACON (init subset no. 4): 7 of 47 (14.89 %)
  Reg-BACON (init subset no. 5): 8 of 47 (17.02 %)
  Reg-BACON (subset no. 1): 15 of 47 (31.91 %)
  Reg-BACON (subset no. 2): 28 of 47 (59.57 %)
  Reg-BACON (subset no. 3): 40 of 47 (85.11 %)
  Reg-BACON (subset no. 4): 42 of 47 (89.36 %)
  Reg-BACON (subset no. 5): 43 of 47 (91.49 %)
  Reg-BACON (subset no. 6): 43 of 47 (91.49 %)
  List of 5
   $ subset   : logi [1:47] TRUE TRUE TRUE TRUE TRUE TRUE ...
   $ tis      : num [1:47] 0.854 1.176 0.674 1.176 1.116 ...
   $ mv.subset: logi [1:47] FALSE FALSE FALSE FALSE TRUE FALSE ...
   $ mv.dis   : num [1:47] 17.44 59.93 7.16 59.93 1.79 ...
   $ steps    : Named int [1:2] 3 6
    ..- attr(*, "names")= chr [1:2] "mv" "lm"
  > (Bgood <- which(B.ST$subset))
   [1]  1  2  3  4  5  6  7  8  9 10 12 13 14 15 16 17 18 19 21 22 23 24 25 26 27
  [26] 28 29 31 32 33 35 36 37 38 39 40 41 42 43 44 45 46 47
  > .Platform$r_arch
  [1] "x64"
  > ## 32-bit <-> 64-bit different results {tested on Linux & Windows Server}
  > is32 <- .Machine$sizeof.pointer == 4 ## <- should work for Linux/MacOS/Windows
  > isMac <- Sys.info()[["sysname"]] == "Darwin"
  > isSun <- Sys.info()[["sysname"]] == "SunOS"
  > isWin <- .Platform$OS.type == "windows"
  > (Platf_arch <- paste0(.Platform$r_arch, # maybe distinguish more, e.g. "no-ldouble", "BLAS" version ,  ??
  +                       if(isWin) "_win"))
  [1] "x64_win"
  > knownPl <- Platf_arch %in% c("x64", "i386_win", "i386") # update!
  > stopifnot(exprs = {
  +     switch(
  +         Platf_arch,
  +         "i386_win" =, # Platform: i386-w64-mingw32/i386 (32-bit); Windows Server x64 (build 14393)
  +         "x64"  = identical(Bgood, c(25L, 27:29, 33L,        38L,      43L, 45L)),
  +         "i386" = identical(Bgood, c(25L, 27:29, 33L, 35:36, 38L, 42L, 43L, 45L)),
  +                                         # older version of i386-windows
  +         ## other platforms:
  +         {
  +             message("Platform architecture (see above) not yet tested for BACON result")
  +             TRUE
  +         })
  + })
  Platform architecture (see above) not yet tested for BACON result
  > 
  > 
  > plot(starsCYG)
  > lmST <- lm(log.light ~ log.Te, data = starsCYG)
  > abline(lmST, col = "gray") # least squares line
  > ## 'subset': A good set of of points (to determine regression):
  > colB <- adjustcolor(2, 1/2)
  > points(log.light ~ log.Te, data = starsCYG, subset = B.ST$subset,
  +        pch = 19, cex = 1.5, col = colB)
  > ## A BACON-derived line:
  > lmB <- lm(log.light ~ log.Te, data = starsCYG, subset = B.ST$subset)
  > abline(lmB, col = colB, lwd = 2)
  > cfT <- switch(Platf_arch # use lm(..., subset = sfsmisc::inverseWhich(Bgood))
  +             , "x64"  = c(-10.130429, 3.4450151)
  +             , "i386" = c(-9.5759001, 3.3109007)
  +              ## otherwise:
  +             , NULL)
  > cf <- unname(coef(lmB))
  > dput(signif(cf, 8))
  c(-4.0565237, 2.0466574)
  > if(!is.null(cfT)) withAutoprint({
  +     all.equal(cf, cfT, tol=0)# 64b: 6.4e-10
  +     stopifnot(all.equal(cf, cfT))
  + })
  > 
  > options(op)
  > 
  > proc.time()
     user  system elapsed 
     2.78    0.32    3.09