Skip to contents

Mini batch version of a rowTestFUN function.

Usage

mini_batch_rowTestFUN(
  rowTestFUN,
  Y,
  categ,
  alternative = c("two.sided", "less", "greater"),
  max_batch_size = 1e+06,
  m = nrow(Y)
)

Arguments

rowTestFUN

A function taking as inputs Y, categ and Alternative and giving as a result a matrix of $p$-values. Example rowWelchTests or rowWilcoxonTests.

Y

A \(m \times n\) numeric matrix whose rows correspond to variables and columns to observations

categ

Either a numeric vector of n categories in \(0, 1\) for the observations, or a n x B matrix stacking B such vectors (typically permutations of an original vector of size n)

alternative

A character string specifying the alternative hypothesis. Must be one of "two.sided" (default), "greater" or "less". As in t.test, alternative = "greater" is the alternative that class 1 has a larger mean than class 0.

max_batch_size

A number specifying the maximum size of information in each batch

m

the number of hypotheses

Value

the p-values for the test

Examples

p <- 53 
n <- 35
mat <- matrix(rnorm(p * n), ncol = n)
cls <- rep(c(0, 1), times = c(10, n - 10))
mini_batch_rowTestFUN(rowTestFUN = rowWelchTests, Y = mat, 
                      categ = cls, alternative = "two.sided", 
                      max_batch_size = 1e6)
#>             [,1]
#>  [1,] 0.83761109
#>  [2,] 0.35790444
#>  [3,] 0.73970315
#>  [4,] 0.38990476
#>  [5,] 0.26935018
#>  [6,] 0.53080625
#>  [7,] 0.93316647
#>  [8,] 0.08363147
#>  [9,] 0.03210593
#> [10,] 0.68953495
#> [11,] 0.33501683
#> [12,] 0.94392278
#> [13,] 0.64805398
#> [14,] 0.10461422
#> [15,] 0.51890420
#> [16,] 0.54616841
#> [17,] 0.09834580
#> [18,] 0.44566613
#> [19,] 0.63191860
#> [20,] 0.07491038
#> [21,] 0.90452217
#> [22,] 0.40042481
#> [23,] 0.18119372
#> [24,] 0.95374563
#> [25,] 0.31949377
#> [26,] 0.30858193
#> [27,] 0.29152039
#> [28,] 0.80377309
#> [29,] 0.88563672
#> [30,] 0.19429705
#> [31,] 0.49435291
#> [32,] 0.60507036
#> [33,] 0.12066767
#> [34,] 0.14516962
#> [35,] 0.24162462
#> [36,] 0.23004937
#> [37,] 0.71542725
#> [38,] 0.18722113
#> [39,] 0.42704875
#> [40,] 0.89259009
#> [41,] 0.26239802
#> [42,] 0.79042701
#> [43,] 0.87883439
#> [44,] 0.67318786
#> [45,] 0.42303057
#> [46,] 0.57517667
#> [47,] 0.52226291
#> [48,] 0.17803030
#> [49,] 0.93315199
#> [50,] 0.14549005
#> [51,] 0.99549660
#> [52,] 0.53100274
#> [53,] 0.90611295