2424# Calculates the range of the mean and standard error and multiplies the standard error
2525# with the quotient of theses ranges.
2626# Default is \code{FALSE}.
27+ # ' @param cb.lambda.start [\code{numeric(1)} | \code{NULL}]\cr
28+ # ' The value of \code{cb.lambda} at the beginning of the optimization.
29+ # ' The \code{makeMBOInfillCritAdaCB} crit takes the progress of the optimization determined by the termination criterion to linearly move from \code{cb.lambda.start} to \code{cb.lambda.end}.
30+ # ' The initial desgin does not account for the progress of the optimization.
31+ # ' Eexcept for \code{makeMBOTerminationMaxExecBudget}) if you dont pass a precalculated initial design.
32+ # ' @param cb.lambda.end [\code{numeric(1)} | \code{NULL}]\cr
33+ # ' The value of \code{cb.lambda} at the end of the optimization.
2734# ' @param aei.use.nugget [\code{logical(1)}]\cr
2835# ' Should the nugget effect be used for the pure variance estimation for augmented
2936# ' expected improvement?
4754# ' @rdname infillcrits
4855makeMBOInfillCritMeanResponse = function () {
4956 makeMBOInfillCrit(
50- fun = function (points , models , control , par.set , design , iter , attributes = FALSE ) {
57+ fun = function (points , models , control , par.set , design , iter , progress , attributes = FALSE ) {
5158 ifelse(control $ minimize , 1 , - 1 ) * predict(models [[1L ]], newdata = points )$ data $ response
5259 },
5360 name = " Mean response" ,
@@ -60,7 +67,7 @@ makeMBOInfillCritMeanResponse = function() {
6067# ' @rdname infillcrits
6168makeMBOInfillCritStandardError = function () {
6269 makeMBOInfillCrit(
63- fun = function (points , models , control , par.set , design , iter , attributes = FALSE ) {
70+ fun = function (points , models , control , par.set , design , iter , progress , attributes = FALSE ) {
6471 - predict(models [[1L ]], newdata = points )$ data $ se
6572 },
6673 name = " Standard error" ,
@@ -76,7 +83,7 @@ makeMBOInfillCritEI = function(se.threshold = 1e-6) {
7683 assertNumber(se.threshold , lower = 1e-20 )
7784 force(se.threshold )
7885 makeMBOInfillCrit(
79- fun = function (points , models , control , par.set , design , iter , attributes = FALSE ) {
86+ fun = function (points , models , control , par.set , design , iter , progress , attributes = FALSE ) {
8087 model = models [[1L ]]
8188 maximize.mult = ifelse(control $ minimize , 1 , - 1 )
8289 y = maximize.mult * design [, control $ y.name ]
@@ -110,7 +117,7 @@ makeMBOInfillCritCB = function(cb.lambda = NULL) {
110117 assertNumber(cb.lambda , lower = 0 , null.ok = TRUE )
111118 force(cb.lambda )
112119 makeMBOInfillCrit(
113- fun = function (points , models , control , par.set , design , iter , attributes = FALSE ) {
120+ fun = function (points , models , control , par.set , design , iter , progress , attributes = FALSE ) {
114121 model = models [[1L ]]
115122 maximize.mult = ifelse(control $ minimize , 1 , - 1 )
116123 p = predict(model , newdata = points )$ data
@@ -152,7 +159,7 @@ makeMBOInfillCritAEI = function(aei.use.nugget = FALSE, se.threshold = 1e-6) {
152159 force(se.threshold )
153160
154161 makeMBOInfillCrit(
155- fun = function (points , models , control , par.set , design , iter , attributes = FALSE ) {
162+ fun = function (points , models , control , par.set , design , iter , progress , attributes = FALSE ) {
156163 model = models [[1L ]]
157164 maximize.mult = ifelse(control $ minimize , 1 , - 1 )
158165 p = predict(model , newdata = points )$ data
@@ -198,7 +205,7 @@ makeMBOInfillCritEQI = function(eqi.beta = 0.75, se.threshold = 1e-6) {
198205 force(se.threshold )
199206
200207 makeMBOInfillCrit(
201- fun = function (points , models , control , par.set , design , iter , attributes = FALSE ) {
208+ fun = function (points , models , control , par.set , design , iter , progress , attributes = FALSE ) {
202209 model = models [[1L ]]
203210 maximize.mult = ifelse(control $ minimize , 1 , - 1 )
204211 # compute q.min
@@ -251,7 +258,7 @@ makeMBOInfillCritDIB = function(cb.lambda = 1, sms.eps = NULL) {
251258 if (! is.null(sms.eps ))
252259 assertNumber(sms.eps , lower = 0 , finite = TRUE )
253260 makeMBOInfillCrit(
254- fun = function (points , models , control , par.set , design , iter , attributes = FALSE ) {
261+ fun = function (points , models , control , par.set , design , iter , progress , attributes = FALSE ) {
255262 # get ys and cb-value-matrix for new points, minimize version
256263 maximize.mult = ifelse(control $ minimize , 1 , - 1 )
257264 ys = as.matrix(design [, control $ y.name ]) %*% diag(maximize.mult )
@@ -292,3 +299,28 @@ makeMBOInfillCritDIB = function(cb.lambda = 1, sms.eps = NULL) {
292299 requires.se = TRUE
293300 )
294301}
302+
303+ # ============================
304+ # Experimental Infill Criteria
305+ # ============================
306+
307+ # ' @export
308+ # ' @rdname infillcrits
309+ makeMBOInfillCritAdaCB = function (cb.lambda.start = NULL , cb.lambda.end = NULL ) {
310+ assertNumber(cb.lambda.start , lower = 0 , null.ok = TRUE )
311+ assertNumber(cb.lambda.end , lower = 0 , null.ok = TRUE )
312+ force(cb.lambda.start )
313+ force(cb.lambda.end )
314+ crit = makeMBOInfillCritCB()
315+ orig.fun = crit $ fun
316+ crit $ fun = function (points , models , control , par.set , design , iter , progress , attributes = FALSE ) {
317+ assertNumber(progress )
318+ cb.lambda = (1 - progress ) * cb.lambda.start + progress * cb.lambda.end
319+ assign(" cb.lambda" , cb.lambda , envir = environment(orig.fun ))
320+ orig.fun(points , models , control , par.set , design , iter , progress , attributes )
321+ }
322+ crit $ name = " Adaptive Confidence bound"
323+ crit $ id = " adacb"
324+ crit $ params = list (cb.lambda.start = cb.lambda.start , cb.lambda.end = cb.lambda.end )
325+ return (addClasses(crit , " InfillCritAdaCB" ))
326+ }
0 commit comments