designMaxMinDist: Max-Min-Distance Design

View source: R/DoE.R

designMaxMinDistR Documentation

Max-Min-Distance Design

Description

Build a design of experiments in a sequential manner: First candidate solution is created at random. Afterwards, candidates are added sequentially, maximizing the minimum distances to the existing candidates. Each max-min problem is resolved by random sampling. The aim is to get a rather diverse design.

Usage

designMaxMinDist(x = NULL, cf, size, control = list())

Arguments

x

Optional list of user specified solutions to be added to the design/population, defaults to NULL

cf

Creation function, creates random new individuals

size

size of the design

control

list of controls. control$distanceFunction requires a distance function to compare two candidates created by cf. control$budget is the number of candidates for the random sampling, defaults to 100.

Value

Returns list with experimental design without duplicates

See Also

optimMaxMinDist, designRandom

Examples

# Create a design of 10 permutations, each with n=5 elements, 
# and with 50 candidates for each sample.
# Note, that in this specific case the number of candidates 
# should be no larger than factorial(n).
# The default (hamming distance) is used.
design <- designMaxMinDist(NULL,function()sample(5),10,
		control=list(budget=50))
# Create a design of 20 real valued 2d vectors, 
# with 100 candidates for each sample
# using euclidean distance.
design <- designMaxMinDist(NULL,function()runif(2),20,
	control=list(budget=100,
	distanceFunction=function(x,y)sqrt(sum((x-y)^2))))
# plot the resulting design
plot(matrix(unlist(design),,2,byrow=TRUE))

CEGO documentation built on May 29, 2024, 3:35 a.m.