allocq_c {hetGP}R Documentation

Allocation under maximum replication constraints

Description

Allocate replicates based on portfolio weights, with constraints on the number of possible designs

Usage

allocq_c(w, q, mr)

Arguments

w

vector of weights

q

scalar batch size

mr

vector of maximum number of evaluation of each element

Details

proceeds by dichotomy

Value

allocation of integer number of runs depending on weights

Examples

set.seed(42)
n <- 10
w <- runif(n)^4
w <- w/sum(w)
q <- 50
mr <- c(rep(2, round(n/2)), rep(q, round(n/2)))
al <- allocq(w = w, q = q)
al_c <- allocq_c(w = w, q = q, mr = mr)
par(mfrow = c(1,2))
plot(w, pch = 20)
plot(mr, ylim = c(0, q), type = "b", col = 4, lty = 3)
segments(x0 = (1:n)-0.02, x1 = (1:n) - 0.02, y0 = rep(0, n), y1 = al)
segments(x0 = (1:n)+0.02, x1 = (1:n) + 0.02, y0 = rep(0, n), y1 = al_c, col = "red")
legend("topleft", legend = c("without max rep", "with max rep"), col = c(1, 2), lty= 1)
par(mfrow = c(1,1))
print(sum(al))
print(sum(al_c))

[Package hetGP version 1.1.8 Index]