Running ‘LTS-specials.R’ [0s/1s]
  Running ‘MCD-specials.R’ [0s/1s]
  Running ‘MT-tst.R’ [4s/6s]
  Running ‘NAcoef.R’ [1s/1s]
  Comparing ‘NAcoef.Rout’ to ‘NAcoef.Rout.save’ ... OK
  Running ‘OGK-ex.R’ [0s/1s]
  Comparing ‘OGK-ex.Rout’ to ‘OGK-ex.Rout.save’ ... OK
  Running ‘Qn-Sn-plots.R’ [0s/1s]
  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/0s]
  Running ‘comedian-tst.R’ [0s/1s]
  Running ‘exact-fit-categorical.R’ [0s/0s]
  Running ‘glmrob-1.R’ [5s/7s]
  Running ‘glmrob-specials.R’ [0s/1s]
  Running ‘huber-etc.R’ [0s/0s]
  Comparing ‘huber-etc.Rout’ to ‘huber-etc.Rout.save’ ... OK
  Running ‘large-values.R’ [0s/1s]
  Running ‘lmrob-data.R’ [2s/3s]
  Running ‘lmrob-ex12.R’ [2s/3s]
  Running ‘lmrob-methods.R’ [0s/1s]
  Comparing ‘lmrob-methods.Rout’ to ‘lmrob-methods.Rout.save’ ... OK
  Running ‘lmrob-psifns.R’ [3s/3s]
  Comparing ‘lmrob-psifns.Rout’ to ‘lmrob-psifns.Rout.save’ ... OK
  Running ‘m-s-estimator.R’ [1s/2s]
  Running ‘mc-etc.R’ [1s/1s]
  Running ‘mc-strict.R’ [9s/11s]
  Running ‘nlregrob-tst.R’ [8s/9s]
  Running ‘nlrob-tst.R’ [2s/3s]
  Running ‘poisson-ex.R’ [1s/1s]
  Running ‘psi-rho-etc.R’ [1s/1s]
  Comparing ‘psi-rho-etc.Rout’ to ‘psi-rho-etc.Rout.save’ ... OK
  Running ‘small-sample.R’ [5s/7s]
  Comparing ‘small-sample.Rout’ to ‘small-sample.Rout.save’ ... OK
  Running ‘subsample.R’ [2s/3s]
  Running ‘tlts.R’ [1s/1s]
  Comparing ‘tlts.Rout’ to ‘tlts.Rout.save’ ... OK
  Running ‘tmcd.R’ [4s/5s]
  Running ‘weights.R’ [1s/1s]
  Comparing ‘weights.Rout’ to ‘weights.Rout.save’ ... OK
  Running ‘wgt-himed-xtra.R’ [2s/3s]
  Running ‘wgt-himed.R’ [0s/0s]
  Comparing ‘wgt-himed.Rout’ to ‘wgt-himed.Rout.save’ ... OK
Running the tests in ‘tests/MCD-specials.R’ failed.
Complete output:
  > #### Test special cases  for  covMcd()
  > 
  > library(robustbase)
  > 
  > ### 1) p = 1 ----------------------------------------------------
  > set.seed(1)
  > x <- c(rnorm(50),100, 1e10)
  > (r1 <- covMcd(x))
  Minimum Covariance Determinant (MCD) estimator approximation.
  Method: Univariate Fast MCD(alpha=0.5 ==> h=27); nsamp = 500; (n,k)mini = (300,5)
  Call:
  covMcd(x = x)
  Log(Det.):  -2.13 
  
  Robust Estimate of Location:
       x  
  0.1922  
  Robust Estimate of Covariance:
          x
  x  0.5978
  > str(r1)
  List of 15
   $ call      : language covMcd(x = x)
   $ nsamp     : num 500
   $ method    : chr "Univariate Fast MCD(alpha=0.5 ==> h=27); nsamp = 500; (n,k)mini = (300,5)"
   $ cov       : num [1, 1] 0.598
    ..- attr(*, "dimnames")=List of 2
    .. ..$ : chr "x"
    .. ..$ : chr "x"
   $ center    : Named num 0.192
    ..- attr(*, "names")= chr "x"
   $ n.obs     : int 52
   $ alpha     : num 0.5
   $ quan      : num 27
   $ raw.cov   : num [1, 1] 0.839
    ..- attr(*, "dimnames")=List of 2
    .. ..$ : chr "x"
    .. ..$ : chr "x"
   $ raw.center: Named num 0.325
    ..- attr(*, "names")= chr "x"
   $ crit      : num -2.13
   $ mcd.wt    : num [1:52] 1 1 1 1 1 1 1 1 1 1 ...
   $ X         : num [1:52, 1] -0.626 0.184 -0.836 1.595 0.33 ...
    ..- attr(*, "dimnames")=List of 2
    .. ..$ : chr [1:52] "1" "2" "3" "4" ...
    .. ..$ : NULL
   $ raw.cnp2  : num [1:2] 6.45 1.14
   $ cnp2      : num [1:2] 1.17 1.01
   - attr(*, "class")= chr "mcd"
  > summary(r1)
  Minimum Covariance Determinant (MCD) estimator approximation.
  Method: Univariate Fast MCD(alpha=0.5 ==> h=27); nsamp = 500; (n,k)mini = (300,5)
  Call:
  covMcd(x = x)
  Log(Det.):  -2.13 
  
  Robust Estimate of Location:
       x  
  0.1922  
  Robust Estimate of Covariance:
          x
  x  0.5978
  
  Eigenvalues:
  [1] 0.5978
  Robustness weights: 
   4 observations c(14,24,51,52) are outliers with |weight| = 0 ( < 0.0019); 
   48 weights are ~= 1.
  > ## with alpha = 1
  > (r1.1 <- covMcd(x, alpha = 1))
  Minimum Covariance Determinant (MCD) estimator approximation.
  Method: MCD(alpha=1 ==> h=52) 
  alpha = 1: The minimum covariance determinant estimates based on 52 observations 
  are equal to the classical estimates.
  Call:
  covMcd(x = x, alpha = 1)
  Log(Det.):  42.1 
  
  Robust Estimate of Location:
      x  
  2.059  
  Robust Estimate of Covariance:
         x
  x  223.9
  > str(r1.1)
  List of 15
   $ call      : language covMcd(x = x, alpha = 1)
   $ nsamp     : num 500
   $ method    : chr "MCD(alpha=1 ==> h=52) \nalpha = 1: The minimum covariance determinant estimates based on 52 observations \nare "| __truncated__
   $ cov       : num [1, 1] 224
    ..- attr(*, "dimnames")=List of 2
    .. ..$ : chr "x"
    .. ..$ : chr "x"
   $ center    : Named num 2.06
    ..- attr(*, "names")= chr "x"
   $ n.obs     : int 52
   $ alpha     : num 1
   $ quan      : num 52
   $ raw.cov   : num [1, 1] 1.92e+18
    ..- attr(*, "dimnames")=List of 2
    .. ..$ : chr "x"
    .. ..$ : chr "x"
   $ raw.center: Named num 1.92e+08
    ..- attr(*, "names")= chr "x"
   $ crit      : num 42.1
   $ mcd.wt    : num [1:52] 1 1 1 1 1 1 1 1 1 1 ...
   $ X         : num [1:52, 1] -0.626 0.184 -0.836 1.595 0.33 ...
    ..- attr(*, "dimnames")=List of 2
    .. ..$ : chr [1:52] "1" "2" "3" "4" ...
    .. ..$ : NULL
   $ raw.cnp2  : num [1:2] 1 1
   $ cnp2      : num [1:2] 1.14 1
   - attr(*, "class")= chr "mcd"
  > summary(r1.1)
  Minimum Covariance Determinant (MCD) estimator approximation.
  Method: MCD(alpha=1 ==> h=52) 
  alpha = 1: The minimum covariance determinant estimates based on 52 observations 
  are equal to the classical estimates.
  Call:
  covMcd(x = x, alpha = 1)
  Log(Det.):  42.1 
  
  Robust Estimate of Location:
      x  
  2.059  
  Robust Estimate of Covariance:
         x
  x  223.9
  
  Eigenvalues:
  [1] 223.9
  Robustness weights: 
   2 observations c(51,52) are outliers with |weight| = 0 ( < 0.0019); 
   50 weights are ~= 1.
  > 
  > ### 1b) p = 1, constant scale
  > (rc <- covMcd(rep(1,12)))
  Minimum Covariance Determinant (MCD) estimator approximation.
  Method: Univariate Fast MCD(alpha=0.5 ==> h=7); nsamp = 500; (n,k)mini = (300,5)
  Call:
  covMcd(x = rep(1, 12))
  Initial scale 0 because more than 'h' (=7) observations are identical.
  Log(Det.):  -Inf 
  
  Robust Estimate of Location:
  rep(1, 12)  
           1  
  Robust Estimate of Covariance:
              rep(1, 12)
  rep(1, 12)           0
  Warning message:
  In covMcd(rep(1, 12)) :
    Initial scale 0 because more than 'h' (=7) observations are identical.
  > str(rc)
  List of 16
   $ call       : language covMcd(x = rep(1, 12))
   $ nsamp      : num 500
   $ method     : chr "Univariate Fast MCD(alpha=0.5 ==> h=7); nsamp = 500; (n,k)mini = (300,5)"
   $ singularity:List of 2
    ..$ kind: chr "identicalObs"
    ..$ q   : num 7
   $ cov        : num [1, 1] 0
    ..- attr(*, "dimnames")=List of 2
    .. ..$ : chr "rep(1, 12)"
    .. ..$ : chr "rep(1, 12)"
   $ raw.cov    : num [1, 1] 0
    ..- attr(*, "dimnames")=List of 2
    .. ..$ : chr "rep(1, 12)"
    .. ..$ : chr "rep(1, 12)"
   $ center     : Named num 1
    ..- attr(*, "names")= chr "rep(1, 12)"
   $ raw.center : Named num 1
    ..- attr(*, "names")= chr "rep(1, 12)"
   $ n.obs      : int 12
   $ alpha      : num 0.5
   $ quan       : num 7
   $ crit       : num -Inf
   $ mcd.wt     : num [1:12] 1 1 1 1 1 1 1 1 1 1 ...
   $ X          : num [1:12, 1] 1 1 1 1 1 1 1 1 1 1 ...
    ..- attr(*, "dimnames")=List of 2
    .. ..$ : chr [1:12] "1" "2" "3" "4" ...
    .. ..$ : NULL
   $ raw.cnp2   : num [1:2] 4.97 1.41
   $ cnp2       : num [1:2] 1 1
   - attr(*, "class")= chr "mcd"
  > summary(rc)
  Minimum Covariance Determinant (MCD) estimator approximation.
  Method: Univariate Fast MCD(alpha=0.5 ==> h=7); nsamp = 500; (n,k)mini = (300,5)
  Call:
  covMcd(x = rep(1, 12))
  Initial scale 0 because more than 'h' (=7) observations are identical.
  Log(Det.):  -Inf 
  
  Robust Estimate of Location:
  rep(1, 12)  
           1  
  Robust Estimate of Covariance:
              rep(1, 12)
  rep(1, 12)           0
  
  Eigenvalues:
  [1] 0
  Robustness weights: 
   All 12 weights are ~= 1.
  > ## with alpha = 1
  > (rc1 <- covMcd(rep(1,12), alpha = 1))
  Minimum Covariance Determinant (MCD) estimator approximation.
  Method: MCD(alpha=1 ==> h=12) 
  alpha = 1: The minimum covariance determinant estimates based on 12 observations 
  are equal to the classical estimates.
  Call:
  covMcd(x = rep(1, 12), alpha = 1)
  The classical covariance matrix is singular.
  Log(Det.):  -Inf 
  
  Robust Estimate of Location:
  rep(1, 12)  
           1  
  Robust Estimate of Covariance:
              rep(1, 12)
  rep(1, 12)           0
  > str(rc1)
  List of 16
   $ call       : language covMcd(x = rep(1, 12), alpha = 1)
   $ nsamp      : num 500
   $ method     : chr "MCD(alpha=1 ==> h=12) \nalpha = 1: The minimum covariance determinant estimates based on 12 observations \nare "| __truncated__
   $ cov        : num [1, 1] 0
    ..- attr(*, "dimnames")=List of 2
    .. ..$ : chr "rep(1, 12)"
    .. ..$ : chr "rep(1, 12)"
   $ center     : Named num 1
    ..- attr(*, "names")= chr "rep(1, 12)"
   $ n.obs      : int 12
   $ singularity:List of 1
    ..$ kind: chr "classical"
   $ alpha      : num 1
   $ quan       : num 12
   $ raw.cov    : num [1, 1] 0
    ..- attr(*, "dimnames")=List of 2
    .. ..$ : chr "rep(1, 12)"
    .. ..$ : chr "rep(1, 12)"
   $ raw.center : Named num 1
    ..- attr(*, "names")= chr "rep(1, 12)"
   $ crit       : num -Inf
   $ mcd.wt     : num [1:12] 1 1 1 1 1 1 1 1 1 1 ...
   $ X          : num [1:12, 1] 1 1 1 1 1 1 1 1 1 1 ...
    ..- attr(*, "dimnames")=List of 2
    .. ..$ : chr [1:12] "1" "2" "3" "4" ...
    .. ..$ : NULL
   $ raw.cnp2   : num [1:2] 1 1
   $ cnp2       : num [1:2] 1 1
   - attr(*, "class")= chr "mcd"
  > summary(rc1)
  Minimum Covariance Determinant (MCD) estimator approximation.
  Method: MCD(alpha=1 ==> h=12) 
  alpha = 1: The minimum covariance determinant estimates based on 12 observations 
  are equal to the classical estimates.
  Call:
  covMcd(x = rep(1, 12), alpha = 1)
  The classical covariance matrix is singular.
  Log(Det.):  -Inf 
  
  Robust Estimate of Location:
  rep(1, 12)  
           1  
  Robust Estimate of Covariance:
              rep(1, 12)
  rep(1, 12)           0
  
  Eigenvalues:
  [1] 0
  Robustness weights: 
   All 12 weights are ~= 1.
  > 
  > ### 2)  constant observations  { multivariate scale == 0 } -----------
  > (X <- matrix(rep(2*(1:4), 12), nrow = 12, byrow = TRUE))
        [,1] [,2] [,3] [,4]
   [1,]    2    4    6    8
   [2,]    2    4    6    8
   [3,]    2    4    6    8
   [4,]    2    4    6    8
   [5,]    2    4    6    8
   [6,]    2    4    6    8
   [7,]    2    4    6    8
   [8,]    2    4    6    8
   [9,]    2    4    6    8
  [10,]    2    4    6    8
  [11,]    2    4    6    8
  [12,]    2    4    6    8
  > (rC  <- covMcd(X))
  Minimum Covariance Determinant (MCD) estimator approximation.
  Method: Fast MCD(alpha=0.5 ==> h=8); nsamp = 500; (n,k)mini = (300,5)
  Call:
  covMcd(x = X)
  The covariance matrix of the data is singular.
  There are 12 observations (in the entire dataset of 12 obs.) lying on
  the hyperplane with equation a_1*(x_i1 - m_1) + ... + a_p*(x_ip - m_p)
  = 0 with (m_1, ..., m_p) the mean of these observations and
  coefficients a_i from the vector a <- c(1, 0, 0, 0)
  Log(Det.):  -Inf 
  
  Robust Estimate of Location:
  [1]  2  4  6  8
  Robust Estimate of Covariance:
        [,1]  [,2]  [,3]  [,4]
  [1,]     0     0     0     0
  [2,]     0     0     0     0
  [3,]     0     0     0     0
  [4,]     0     0     0     0
  Warning message:
  In covMcd(X) :*** buffer overflow detected ***: terminated
  Aborted
Running the tests in ‘tests/subsample.R’ failed.
Complete output:
  > ### test subsample
  > ### LU decomposition and singular subsamples handling
  > require(robustbase)
  Loading required package: robustbase
  > source(system.file("xtraR/subsample-fns.R", package = "robustbase", mustWork=TRUE))
  > ## instead of relying on  system.file("test-tools-1.R", package="Matrix"):
  > source(system.file("xtraR/test-tools.R", package = "robustbase")) # assert.EQ(), showProc.time() ..
  > options(nwarnings = 4e4, warnPartialMatchArgs = FALSE)
  > 
  > cat("doExtras:", doExtras <- robustbase:::doExtras(),"\n")
  doExtras: FALSE 
  > showProc.time()
  Time (user system elapsed): 0 0 0.001 
  > 
  > A <- rbind(c(0.001, 1),
  +            c(1,     2))
  > set.seed(11)
  > ## IGNORE_RDIFF_BEGIN
  > sa <- tstSubsample(A) # (now typically also shows Matrix version ..)
  Loading required package: Matrix
          _                                                                               
  Version 1.7-5                                                                           
  Date    2026-03-20                                                                      
  file    /home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/Matrix/Meta/package.rds
  > ## IGNORE_RDIFF_END
  > str(sa)
  List of 21
   $ x        : num [1:2, 1:2] 0.001 1 1 2
   $ y        : num [1:2] -0.591 0.0266
   $ n        : int 2
   $ m        : int 2
   $ beta     : num [1:2] 1.211 -0.592
   $ ind_space: int [1:2] 0 1
   $ idc      : int [1:2] 0 1
   $ idr      : int [1:2] 1 0
   $ lu       : num [1:2, 1:2] 1 0.001 2 0.998
   $ v        : num [1:2] 1 0.998
   $ pivot    : int 1
   $ Dr       : num [1:2] 1 0.5
   $ Dc       : num [1:2] 2 1
   $ rowequ   : int 0
   $ colequ   : int 0
   $ status   : int 0
   $ sample   : logi FALSE
   $ mts      : int 0
   $ ss       : int 1
   $ tolinv   : num 1e-07
   $ solve    : logi TRUE
  > 
  > A <- rbind(c(3, 17, 10),
  +            c(2,  4, -2),
  +            c(6, 18, 12))
  > tstSubsample(A)
  > 
  > ## test some random matrix
  > set.seed(1002)
  > A <- matrix(rnorm(100), 10)
  > tstSubsample(A)
  > 
  > ## test singular matrix handling
  > A <- rbind(c(1, 0, 0),
  +            c(0, 1, 0),
  +            c(0, 1, 0),
  +            c(0, 0, 1))
  > tstSubsample(A)
  > 
  > 
  > ## test subsample with mts > 0
  > data <- data.frame(y = rnorm(9), expand.grid(A = letters[1:3], B = letters[1:3]))
  > x <- model.matrix(y ~ ., data)
  > y <- data$y
  > ## this should produce a warning and return status == 2
  > showSys.time(z <- Rsubsample(x, y, mts=2))
  Time    user  system elapsed 
  Time   0.001   0.000   0.001 
  Warning message:
  In Rsubsample(x, y, mts = 2) :*** buffer overflow detected ***: terminated
  Aborted