R/OSOAs_regular.R
OSOAs_regular.RdThe OSOA in s^k runs accommodates at most m=(s^(k-1)-1)/(s-1) columns in s^2 levels or m'=2*floor(m/2) columns in s^3 levels.
OSOAs_regular(
s,
k,
el = 3,
m = NULL,
noptim.rounds = 1,
noptim.repeats = 1,
optimize = TRUE,
dmethod = "manhattan",
p = 50
)the prime or prime power to use (do not use for s=2, because other method is better); the resulting array will have pairwise orthogonal columns in s^t levels
integer >=3; determines the run size: the resulting array will have s^k runs
2 or 3; the exponent of the number of levels, el=3 yields a
strength 2* or 3 OSOA in s^3 levels, el=2 a strength 2+ or 3- OSOA in s^2 levels
the desired number of columns of the resulting array; for
el=3, odd values of m will be reduced by one, so specify the
next largest even m, if you need an odd number of columns (the function
will do so, if possible); if m=NULL, the maximum possible value is used.
This is at most (s^(k-1)-1)/(s-1), or one less if this is odd and el=3.
the number of optimization rounds for each independent restart
the number of independent restarts of optimizations with noptim.rounds rounds each
logical: should space filling be optimized by level permutations?
distance method for phi_p, "manhattan" (default) or "euclidean"
p for phi_p (the larger, the closer to maximin distance)
matrix of class SOA with the attributes that are listed below. All attributes can be accessed using function attributes, or individual attributes can be accessed using function attr. These are the attributes:
the type of array (SOA or OSOA)
character string that gives the strength
the phi_p value (smaller=better)
logical indicating whether optimization was applied
matrix that lists the id numbers of the permutations used
optional element, when optimization was conducted: the overall permutation list to which the numbers in permlist refer
the call that created the object
The function implements the algorithms proposed by Zhou and Tang 2018 (s^2 levels) or Li, Liu and Yang 2021 (s^3 levels), enhanced with the modification for matrix A by Groemping (2023a). Level permutations are optimized using an adaptation of the algorithm by Weng (2014).
If m is specified, the function uses the last m columns of
a saturated OA produced by function createSaturated(s, k-1).
If m is small enough that a resolution IV / strength 3 OA for s levels in s^(k-1) runs exists,
function OSOAs should be used with such an OA (which can be obtained from package FrF2
for s=2 or from package DoE.base for s>2). For s=2,
function OSOAs_hadamard may also be a better choice than OSOAs_regular for
up to 192 runs.
For full detail, see SOAs-package.
Groemping (2023a)
Li, Liu and Yang (2021)
Weng (2014)
Zhou and Tang (2019)
## 13 columns in 9 levels each
OSOAs_regular(3, 4, el=2, optimize=FALSE) ## 13 columns, phi_p about 0.117
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
#> [1,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [2,] 4 4 4 4 4 4 4 4 0 0 0 0 4
#> [3,] 8 8 8 8 8 8 8 8 0 0 0 0 8
#> [4,] 8 8 8 4 4 4 0 0 4 4 0 4 0
#> [5,] 0 0 0 8 8 8 4 4 4 4 0 4 4
#> [6,] 4 4 4 0 0 0 8 8 4 4 0 4 8
#> [7,] 4 4 4 8 8 8 0 0 8 8 0 8 0
#> [8,] 8 8 8 0 0 0 4 4 8 8 0 8 4
#> [9,] 0 0 0 4 4 4 8 8 8 8 0 8 8
#> [10,] 8 4 0 8 4 0 8 4 8 4 4 0 0
#> [11,] 0 8 4 0 8 4 0 8 8 4 4 0 4
#> [12,] 4 0 8 4 0 8 4 0 8 4 4 0 8
#> [13,] 4 0 8 0 8 4 8 4 0 8 4 4 0
#> [14,] 8 4 0 4 0 8 0 8 0 8 4 4 4
#> [15,] 0 8 4 8 4 0 4 0 0 8 4 4 8
#> [16,] 0 8 4 4 0 8 8 4 4 0 4 8 0
#> [17,] 4 0 8 8 4 0 0 8 4 0 4 8 4
#> [18,] 8 4 0 0 8 4 4 0 4 0 4 8 8
#> [19,] 4 8 0 4 8 0 4 8 4 8 8 0 0
#> [20,] 8 0 4 8 0 4 8 0 4 8 8 0 4
#> [21,] 0 4 8 0 4 8 0 4 4 8 8 0 8
#> [22,] 0 4 8 8 0 4 4 8 8 0 8 4 0
#> [23,] 4 8 0 0 4 8 8 0 8 0 8 4 4
#> [24,] 8 0 4 4 8 0 0 4 8 0 8 4 8
#> [25,] 8 0 4 0 4 8 4 8 0 4 8 8 0
#> [26,] 0 4 8 4 8 0 8 0 0 4 8 8 4
#> [27,] 4 8 0 8 0 4 0 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 1 1 6 1 6
#> [59,] 6 6 6 5 5 5 1 1 1 1 6 1 1
#> [60,] 1 1 1 6 6 6 5 5 1 1 6 1 5
#> [61,] 1 1 1 5 5 5 6 6 5 5 6 5 6
#> [62,] 5 5 5 6 6 6 1 1 5 5 6 5 1
#> [63,] 6 6 6 1 1 1 5 5 5 5 6 5 5
#> [64,] 5 1 6 5 1 6 5 1 5 1 1 6 6
#> [65,] 6 5 1 6 5 1 6 5 5 1 1 6 1
#> [66,] 1 6 5 1 6 5 1 6 5 1 1 6 5
#> [67,] 1 6 5 6 5 1 5 1 6 5 1 1 6
#> [68,] 5 1 6 1 6 5 6 5 6 5 1 1 1
#> [69,] 6 5 1 5 1 6 1 6 6 5 1 1 5
#> [70,] 6 5 1 1 6 5 5 1 1 6 1 5 6
#> [71,] 1 6 5 5 1 6 6 5 1 6 1 5 1
#> [72,] 5 1 6 6 5 1 1 6 1 6 1 5 5
#> [73,] 1 5 6 1 5 6 1 5 1 5 5 6 6
#> [74,] 5 6 1 5 6 1 5 6 1 5 5 6 1
#> [75,] 6 1 5 6 1 5 6 1 1 5 5 6 5
#> [76,] 6 1 5 5 6 1 1 5 5 6 5 1 6
#> [77,] 1 5 6 6 1 5 5 6 5 6 5 1 1
#> [78,] 5 6 1 1 5 6 6 1 5 6 5 1 5
#> [79,] 5 6 1 6 1 5 1 5 6 1 5 5 6
#> [80,] 6 1 5 1 5 6 5 6 6 1 5 5 1
#> [81,] 1 5 6 5 6 1 6 1 6 1 5 5 5
#> OSOA, strength 2+
# optimizing level permutations typically improves phi_p a lot
# OSOAs_regular(3, 4, el=2) ## 13 columns, phi_p typically below 0.055