R/phi_optimize.R
phi_optimize.Rd
takes an n x m array and returns an n x m array with improved phi_p value (if possible)
phi_optimize(
D,
noptim.rounds = 1,
noptim.repeats = 1,
dmethod = "manhattan",
p = 50
)
numeric matrix or data.frame with numeric columns, n x m. A symmetric array (e.g. an OA) with nl
levels for each columns. Levels must be coded as 0 to nl - 1
or as 1 to nl
. levels from
number of rounds in the Weng algorithm
number of independent repeats of the Weng algorithm
distance method for phi_p
, "manhattan" (default) or "euclidean"
p for phi_p
(the larger, the closer to maximin distance)
an n x m matrix
The function uses the algorithm proposed by Weng (2014) for SOA optimization:
It starts with a random permutation of column levels.
Initially, individual columns are randomly permuted (m permuted matrices, called one-neighbours), and the best permutation w.r.t. the phi_p
value (manhattan distance) is
is made the current optimum. This continues, until the current optimum is not improved by a set of randomly drawn one-neighbours.
Subsequently, pairs of columns are randomly permuted (choose(m,2)
permuted matrices, called two-neighbours). If the current optimum can be improved or the number of optimization rounds has not yet been exhausted,
a new round with one-neighbours is started with the current optimum. Otherwise, the current optimum is returned, or an independent repeat is initiated (if requested).
Limited experience suggests that an increase of noptim.rounds
from the default 1 is often helpful, whereas an increase of noptim.repeats
did not yield as much improvement.
oa <- lhs::createBoseBush(8,16)
print(phi_p(oa, dmethod="manhattan"))
#> [1] 0.04838463
oa_optimized <- phi_optimize(oa)
print(phi_p(oa_optimized, dmethod="manhattan"))
#> [1] 0.04149836