R/OSOAs_LiuLiu.R
OSOAs_LiuLiu.Rd
Creates OSOAs from an OA according to the construction by Liu and Liu (2015). Strengths 2 to 4 are covered. Strengths 3 and 4 guarantee 3-orthogonality.
OSOAs_LiuLiu(
oa,
t = NULL,
m = NULL,
noptim.rounds = 1,
noptim.repeats = 1,
optimize = TRUE,
dmethod = "manhattan",
p = 50
)
matrix or data.frame; a symmetric orthogonal array of strength at least t
the requested strength of the OSOA
the requested number of columns of the OSOA (at most mbound_LiuLiu(ncol(oa), t)
).
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 number of columns goes down dramatically with the requested strength. However, the strength 3 or 4 arrays may be worthwhile, because they guarantee 3-orthogonality, which implies that (quantitative) linear models with main effects and second order effects can be robustly estimated.
Optimization is less successful for this construction of OSOAs; for small arrays, the level permutations make (almost) no difference.
Function mbound_LiuLiu(moa, t)
calculates the number of columns that can be
obtained from a strength t
OA with moa
columns (if such an array
exists, the function does not check that).
Ingoing arrays can be obtained
from oa-generating functions of R package lhs like createBoseBush
, or from OAs in
R package DoE.base, or from 2-level designs created with R package FrF2 (see example section).
## strength 2, very small (four 9-level columns in 9 runs)
OSOA9 <- OSOAs_LiuLiu(DoE.base::L9.3.4)
#> Optimization 1 of 1 started
#> Optimization round 1 of 1 started
## strength 3, from a Plackett-Burman design of FrF2
## 10 8-level columns in 40 runs with OSOA strength 3
oa <- suppressWarnings(FrF2::pb(40)[,c(1:19,39)])
### columns 1 to 19 and 39 together are the largest possible strength 3 set
OSOA40 <- OSOAs_LiuLiu(oa, optimize=FALSE) ## strength 3, 8 levels
### optimize would improve phi_p, but suppressed for saving run time
## 9 8-level columns in 40 runs with OSOA strength 3
oa <- FrF2::pb(40,19)
### 9 columns would be obtained without the final column in oa
mbound_LiuLiu(19, t=3) ## example for which q=3
#> [1] 9
mbound_LiuLiu(19, t=4) ## t=3 has one more column than t=4
#> [1] 8
OSOA40_2 <- OSOAs_LiuLiu(oa, optimize=FALSE) ## strength 3, 8 levels
### optimize would improve phi_p, but suppressed for saving run time
## starting from a strength 4 OA
oa <- FrF2::FrF2(64,8)
## four 16 level columns in 64 runs with OSOA strength 4
OSOA64 <- OSOAs_LiuLiu(oa, optimize=FALSE) ## strength 4, 16 levels
### reducing the strength to 3 does not increase the number of columns
mbound_LiuLiu(8, t=3)
#> [1] 4
### reducing the strength to 2 doubles the number of columns
mbound_LiuLiu(8, t=2)
#> [1] 8
## eight 4-level columns in 64 runs with OSOA strength 2
OSOA64_2 <- OSOAs_LiuLiu(oa, t=2, optimize=FALSE)
## fulfills the 2D strength 2 property
soacheck2D(OSOA64_2, s=2, el=2, t=2)
#> [1] TRUE
### fulfills also the 3D strength 3 property
soacheck3D(OSOA64_2, s=2, el=2, t=3)
#> [1] TRUE
### fulfills also the 4D strength 4 property
DoE.base::GWLP(OSOA64/2)
#> Warning: at least one factor has more than 15 levels
#> Something wrong?
#> 0 1 2 3 4
#> 1 0 42 168 813
### but not the 3D strength 4 property
soacheck3D(OSOA64_2, s=2, el=2, t=4)
#> [1] FALSE
### and not the 2D 4x2 and 2x4 stratification balance
soacheck2D(OSOA64_2, s=2, el=2, t=3)
#> [1] FALSE
## six 36-level columns in 72 runs with OSOA strength 2
oa <- DoE.base::L72.2.5.3.3.4.1.6.7[,10:16]
OSOA72 <- OSOAs_LiuLiu(oa, t=2, optimize=FALSE)