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
  • Radial basis function surrogate
Surrogates.RadialBasisMethod

RadialBasis(x,y,bounds,phi::Function,q::Int)

Constructor for RadialBasis surrogate

  • (x,y): sampled points
  • bounds: region of interest of the form [[a,b],[c,d],...,[w,z]]
  • phi: radial basis of choice
  • q: number of polynomial elements
source
  • Kriging surrogate
Surrogates.KrigingMethod
Kriging(x,y,p,theta)

Constructor for Kriging surrogate.

  • (x,y): sampled points
  • p: array of values 0<=p<2 modelling the smoothness of the function being approximated in the i-th variable. low p -> rough, high p -> smooth
  • theta: array of values > 0 modellig how much the function is changing in the i-th variable
source
  • Kriging surrogate based on a Stheno backend
Surrogates.SthenoKrigingType

SthenoKriging(x::X, y::Y, GP::Stheno.GP=Stheno.GP(Stheno.EQ(), Stheno.GPC()), σ²=1e-18)

Returns a Kriging (or Gaussian process) surrogate conditioned on the data points x and y. The GP is the base Gaussian process defined with Stheno.

Arguments

  • x::X: Vector containing the observation points
  • y::Y: Vector containing the observed points
  • GP::Stheno.GP: The base Gaussian process used to condition over. A simple prior is

provided as default. If there are multiple observation dimensions, a Tuple of Gaussian processes can be passed, otherwise the same process is used across all dimensions.

  • σ²=1e-18: Variance of the observation noise, default is equivalent to no noise
source
function (k::SthenoKriging)(val)

Gives the mean predicted value for the SthenoKriging object.

source
  • Lobachesky surrogate
  • Support vector machine surrogate, requires using LIBSVM
Currently unavailable due to problems with LIBSVM
  • 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
  2. Define add_point!(your_surrogate::AbstactSurrogate,x_new,y_new)
  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

function add_point!(NewSurrogate,x\_new,y\_new)

  nothing
end

function (s::NewSurrogate)(value)
  return s.coeff*value + s.alpha
end