Description Usage Arguments Details Value Author(s) References Examples
Generates a spacefilling design under the criterion of maximumminimum distance; both discrete and continuous searches are provided.
1 2 
n 
the number of spacefilling locations 
Xcand 
the candidate set, from which each spacefilling location is selected 
Tmax 
the number of iterations; 
Xorig 
the existing design; 
init 
the initial indices of 
verb 
progress indicator — every tenth iteration is printed out; by default 
tempfile 
the name of a temporary file given the progress is saved with each iteration; by default 
p 
the dimensionality of input space 
T 
the number of iterations; T > n; setting T = 10 * n is a good starting point. 
Xinit 
the (initial) design introduced from a previous experiment 
plot 
if 
boundary 
if 
Constructing a spacefilling design under the criterion of maximumminimum distance is quite useful in computer experiments and related fields. Previously, researchers would construct such a design in a random acceptreject way, i.e., randomly propose a location within the study region to replace a randomly selected row from the initial design. If such a proposal increases the minimum pairwise Euclidean distance, then accept the replacement; otherwise keep the original design location. By repeatedly proposing (and acceptrejecting) in this way one is able to construct an (approximately) spacefilling design. However the algorithm is inefficient computationally. The reason is that the proposals are not optimized in any way.
In this package, we provide an alternative to build up a welldefined spacefilling design
more efficiently. There are two versions, one is with discrete search, while the other is
with continuous search. For the former, each iteration proposes to swap out a row from the
initial design with the minimum distance, and swap in one location from a candidate set to
increase the minimum distance. For the latter, the core idea is the same, but instead of working
with a candidate set, optim
is used to maximize the distance between the "tobeswappedin"
location and other design locations as well as to any existing design, Xorig
. Several
heuristics are deployed for situations where the search becomes stuck in a local mode. One
involves moving to a location with nonminimum distance, and the other is to jump to a location
which has the maximum minimum distance.
For a visualization of applying maximin.cand
in a reallife problem on solar irradiance, see Sun et al. (2019).
maximin.cand
returns the indices of Xcand
, which makes the final spacefilling design,
and the minimum pairwise Euclidean distance with each iteration
maximin
returns the combined existing design and the spacefilling design,
together with the minimum pairwise Euclidean distance with each iteration
maximin.cand
returns

the indices of 

the minimum distance with each iteration; 
maximin
returns



the minimum distance with each iteration; 
Furong Sun furongs@vt.edu and Robert B. Gramacy rbg@vt.edu
F. Sun, R.B. Gramacy, B. Haaland, S.Y. Lu, and Y. Hwang (2019) Synthesizing Simulation and Field Data of Solar Irradiance, Statistical Analysis and Data Mining, 12(4), 311324; preprint on arXiv:1806.05131.
M.H.Y. Tan (2013) Minimax Designs for Finite Design Regions, Technometrics, 55(3), 346358.
M.E. Johnson, L.M. Moore, and D. Yivisaker (1990) Minimax and Maximin Distance Designs, Journal of Statistical Planning and Inference, 26(2), 131148.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 
## Not run:
## maximin.cand
# generate the design
library("lhs")
n < 100
p < 2
Xorig < randomLHS(10, p)
x1 < seq(0, 1, length.out=n)
Xcand < expand.grid(replicate(p, x1, simplify=FALSE))
names(Xcand) < paste0("x", 1:2)
T < nrow(Xcand)
Xsparse < maximin.cand(n=n, Xcand=Xcand, Tmax=T, Xorig=Xorig,
init=NULL, verb=FALSE, tempfile=NULL)
maxmd < as.numeric(format(round(max(na.omit(Xsparse$mis)), 5), nsmall=5))
# visualization
par(mfrow=c(1, 2))
X < Xcand[Xsparse$inds,]
plot(X$x1, X$x2, xlab=expression(x[1]), ylab=expression(x[2]),
xlim=c(0, 1), ylim=c(0, 1),
main=paste0("n=", n, "_p=", p, "_maximin=", maxmd))
points(Xorig, col=2, pch=20)
abline(h=c(0, 1), v=c(0, 1), lty=2, col=2)
if(!is.null(Xorig))
{
legend("topright", "Xorig", xpd=TRUE, horiz=TRUE,
inset=c(0.03, 0.05), pch=20, col=2, bty="n")
}
plot(log(na.omit(Xsparse$mis)), type="b",
xlab="iteration", ylab="log(minimum distance)",
main="progress on minimum distance")
abline(v=n, lty=2)
mtext(paste0("design size=", n), at=n, cex=0.6)
## End(Not run)
## maximin
# generate the design
library("lhs")
n < 10
p < 2
T < 10*n
Xorig < randomLHS(10, p)
Xsparse < maximin(n=n, p=p, T=T, Xorig=Xorig, Xinit=NULL,
verb=FALSE, plot=FALSE, boundary=FALSE)
maxmd < as.numeric(format(round(Xsparse$mi[T+1], 5), nsmall=5))
# visualization
par(mfrow=c(1,2))
plot(Xsparse$Xf[,1], Xsparse$Xf[,2], xlab=expression(x[1]), ylab=expression(x[2]),
xlim=c(0, 1), ylim=c(0, 1),
main=paste0("n=", n, " p=", p, " T=", T, " maximin=", maxmd))
points(Xorig, col=2, pch=20)
abline(h=c(0,1), v=c(0,1), lty=2, col=2)
if(!is.null(Xorig)) legend("topright", "Xorig", xpd=TRUE, horiz=TRUE,
inset=c(0.03, 0.05), pch=20, col=2, bty="n")
plot(log(Xsparse$mi), type="b", xlab="iteration", ylab="log(minimum distance)",
main="progress on minimum distance")
abline(v=n, lty=2)
mtext(paste0("design size=", n), at=n, cex=0.6)
abline(v=T, lty=2)
mtext(paste0("max.md=", maxmd), at=T, cex=0.6)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.