Description Usage Format Value Fields Methods Examples
Class providing object with methods for bSMED
1 |
R6Class object.
Object of R6Class with methods for running a bSMED experiment.
XDesign matrix
ZResponses
bbatch size to select each iteration
nbNumber of batches, includes the first iteration taking X0
DDimension of data
XoptsAvailable points
X0Initial design
packageWhich GP package to use in IGP. Default is "laGP" and probably is best choice.
statsList of tracked stats
iterationWhich iteration
modThe GP model from IGP
funcThe function to maximize
func_run_togetherShould the new points to evaluate be passed to func as a matrix of all new points in row or each separately as a vector. The matrix form (TRUE) lets you have all points passed at once to your function.
func_fastWhether the function is fast to evaluate and thus can be used to estimate MSE and plot it. Probably TRUE for simple tests, but FALSE for real experiments
objCharacter telling what the objective function is, e.g. max or grad
obj_funcFunction to evaluate the objective
obj_alphaA parameter that can be used to have model focus on uncertain areas when model is poor. Not implemented now.
scale_objIf the objective is not in [0,1), then this will scale it so it works with this method. Also can choose whether use_alpha. Either way the lowest value is scaled to zero. Both choices for use_alpha do similar things, not sure which is better.
n0How many points were in initial design, not important since X0 must be given in
alphaEstimated parameter. Scalar if scale_obj==FALSE as in paper. Vector with lower and upper bounds of p if scale_obj==TRUE, this is my own addition, not in paper.
use_alphaWhether alpha should be estimated and used. This should be TRUE if function output is in [0,1) as required in paper. Can be FALSE if usings scale_obj.
alpha_regression_i_valuesValues used to estimate alpha (iteration)
alpha_regression_p_valuesValues used to estimate alpha (max func value)
gammaPower used in energy
gammamaxA maximum value for gamma, a fraction is used based on the iteration
tauThreshold for design region adaptation
kappaParameter for design region adaptation
deltaA small positive number to make sure the algorithm converges. The paper doesn't mention what value to use, 1e-3 seems to work but I have no clue.
Xopts_removedXopts values that were removed by the design region adaptation
pXp values for rows of X
pXoptsp values for rows of Xopts
qXq values for rows of q
qXoptsp values for rows of Xopts
pFunction used to calculate energy based on the model.
use_design_region_fixI think it makes more sense to use the quantile of the average instead of the average of the quantiles. FALSE does what is in paper and is default.
exchange_algorithm_restartsHow many restarts for exchange algorithm. I didn't see a difference with more restarts.
parallelShould the new values be calculated in parallel? Not for the model, for getting actual new Z values. Can cause trouble since I haven't used it much.
parallel_coresNumber of cores used for parallel
parallel_clusterThe object for the cluster currently running
verbose0 means print nothing, 1 means print somewhat important things, 2 means print a lot. Not much implemented though.
For full documentation of each method go to https://github.com/CollinErickson/bSMED
new(D,
package="laGP", obj=NULL,
func, func_run_together=FALSE, func_fast=TRUE,
use_alpha=TRUE, scale_obj=NULL,
delta=1e-3,
use_design_region_fix = FALSE,
exchange_algorithm_restarts=1,
X0, Xopts, b, nb,
estimate.nugget=FALSE, set.nugget=1e-8,
parallel=FALSE, parallel_cores="detect",
verbose=0,
...)This method is used to create object of this class. User must give D, func, X0, Xopts, b, and nb.
run(maxit=self$nb - self$iteration + 1,
plotlastonly=F, noplot=F)This method run the model. It runs maxit iterations, which defaults to the end of the experiment as determined by nb. plotlastonly only shows last plot, noplot shows no plots.
run1(plotit=TRUE)This method runs a single iteration. It plots the results if plotit==TRUE.
plot1()This method plots the the current model.
print_results(give_best_prediction=TRUE)This prints the best design point found in the experiment. If give_best_prediction==TRUE, it prints where it thinks the maximum of the surface is.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | set.seed(0)
a <- bSMED$new(D=2,func=TestFunctions::gaussian1, obj="func",
n0=0,b=3, nb=5,
X0=lhs::maximinLHS(20,2),
Xopts=lhs::maximinLHS(500,2),
parallel=FALSE)
a$run()
set.seed(1)
a <- bSMED$new(D=2,func=TestFunctions::quad_peaks_slant,
obj="func", n0=0,b=3, nb=5,
X0=lhs::maximinLHS(20,2),
Xopts=lhs::maximinLHS(500,2),
use_alpha=TRUE, package="laGP",
parallel=FALSE, func_fast=TRUE,
use_design_region_fix=TRUE)
a$run()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.