This example shows how to plot the error model and the best objective trace after the optimization has finished. The objective function for this example throws an error for points with norm larger than 2.
function f = makeanerror(x)
f = x.x1 - x.x2 - sqrt(4-x.x1^2-x.x2^2);
fun = @makeanerror;
Create the variables for optimization.
var1 = optimizableVariable('x1',[-5,5]);
var2 = optimizableVariable('x2',[-5,5]);
vars = [var1,var2];
Run the optimization without any plots. For reproducibility, set the random seed and use the 'expected-improvement-plus' acquisition function. Optimize for 60 iterations so the error model becomes well-trained.
Plot each constraint model surface. Negative values indicate feasible
points.
Also plot a
P(feasible)
surface.
Also plot the error model, if
it exists, which ranges from –1
to 1. Negative values mean that
the model probably does not error, positive values
mean that it probably does error. The model
is:
Plotted error =
2*Probability(error) – 1.
@plotObjectiveEvaluationTimeModel
Plot the objective function evaluation time model surface.
@plotObjectiveModel
Plot the fun model surface, the estimated
location of the minimum, and the location of the next proposed point
to evaluate. For one-dimensional problems, plot envelopes one credible
interval above and below the mean function, and envelopes one noise
standard deviation above and below the mean.
Trace Plots — Apply to All
D
Description
@plotObjective
Plot each observed function value versus the number of
function evaluations.
@plotObjectiveEvaluationTime
Plot each observed function evaluation run time versus
the number of function evaluations.
@plotMinObjective
Plot the minimum observed and estimated function values
versus the number of function evaluations.
@plotElapsedTime
Plot three curves: the total elapsed time of the optimization,
the total function evaluation time, and the total modeling and point
selection time, all versus the number of function evaluations.