# Surrogate

Every surrogate has a different definition depending on the parameters needed. However, they have in common:

1. add_point!(::AbstractSurrogate,x_new,y_new)
2. AbstractSurrogate(value)

The first function adds a sample point to the surrogate, thus changing the internal coefficients. The second one calculates the approximation at value.

• Linear surrogate
• Kriging surrogate
Surrogates.KrigingMethod
Kriging(x,y,lb,ub;p=collect(one.(x[1])),theta=collect(one.(x[1])))

Constructor for Kriging surrogate.

• (x,y): sampled points
• p: array of values 0<=p<2 modeling the smoothness of the function being approximated in the i-th variable. low p -> rough, high p -> smooth
• theta: array of values > 0 modeling how much the function is changing in the i-th variable.
source
• Lobachesky surrogate
• Support vector machine surrogate, requires using LIBSVM
Missing docstring.

Missing docstring for SVMSurrogate(x,y,lb::Number,ub::Number). Check Documenter's build log for details.

• Random forest surrogate, requires using XGBoost
• Neural network surrogate, requires using Flux

# Creating another surrogate

It's great that you want to add another surrogate to the library! You will need to:

1. Define a new mutable struct and a constructor function
3. Define your_surrogate(value) for the approximation

Example

mutable struct NewSurrogate{X,Y,L,U,C,A,B} <: AbstractSurrogate
x::X
y::Y
lb::L
ub::U
coeff::C
alpha::A
beta::B
end

function NewSurrogate(x,y,lb,ub,parameters)
...
return NewSurrogate(x,y,lb,ub,calculated\_coeff,alpha,beta)
end

end