This function generates a uniform design for discrete factors with different number of levels.
uniform.discrete(
t,
p,
levels,
design = NULL,
max.sa.iter = 1e+06,
temp = 0,
decay = 0.95,
no.update.iter.max = 400,
num.passes = 10,
max.det.iter = 1e+06,
method = "full",
scaled = TRUE
)final design points.
design transformed to integer numbers for each dimenion
total number of swaps in the optimization.
final optimized criterion.
criterion history during the optimization process.
multiple of the least common multiple of the levels.
design dimension.
a vector of the number of levels for each dimension.
an initial design. If design=NULL, a random design is generated.
maximum number of swapping involved in the simulated annealing (SA) algorithm.
initial temperature of the simulated annealing algorithm. If temp=0, it will be automatically determined.
the temperature decay rate of simulated annealing.
the maximum number of iterations where there is no update to the global optimum before SA stops.
the maximum number of passes of the whole design matrix if deterministic swapping is used.
maximum number of swapping involved in the deterministic swapping algorithm.
choice of "deterministic", "sa", or "full". If the method="full", the design is first optimized by SA and then deterministic swapping.
whether the design is scaled to unit hypercube. If scaled=FALSE, the design is represented by integer numbers from 1 to design size. Leave it as TRUE when no initial design is provided.
uniform.discrete generates a uniform design of discrete factors with different number of levels by minimizing the wrap-around discrepancy criterion (see uniform.crit).
p = 5
levels = c(3, 4, 6, 2, 3)
t = 1
D = uniform.discrete(t, p, levels)
Run the code above in your browser using DataLab