# Radial basis functions in surrogates.jl?

**URL:** <https://discourse.julialang.org/t/radial-basis-functions-in-surrogates-jl/99144>\
**Category:** Machine Learning\
**Created:** [May 20, 2023, 4:49am UTC](https://discourse.julialang.org/t/radial-basis-functions-in-surrogates-jl/99144 "2023-05-20T04:49:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkube](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rkube/32/211198_2.png) [@rkube](https://discourse.julialang.org/u/rkube)\
**Post date:** [May 20, 2023, 4:49am UTC](https://discourse.julialang.org/t/radial-basis-functions-in-surrogates-jl/99144/1 "2023-05-20T04:49:09Z")

</div>

Hi,  
I’m trying to understand what RBFs Surrogates.jl is using. For example, the [documentation](https://docs.sciml.ai/Surrogates/stable/surrogate/) only specifies that it uses `RadialBasis` . The [code] specifies that there is a `linearRadial` and `cubicRadial`. What equation is used as the surrogate?

In the literature, there are also multiple definitions for RBFs:

[Wikipedia](https://en.wikipedia.org/wiki/Radial_basis_function) only lists the Kernel, f.ex. `exp(-r^2)`  
[SMT](https://smt.readthedocs.io/en/latest/_src_docs/surrogate_models/rbf.html) Describes a sum of RBFs with a polynomial term.  
[Another write-up](https://www.di.fc.ul.pt/~jpn/r/rbf/rbf.html) Drops the polynomial term.

---

<div class="post-metadata">

**Author:** ![math4mad](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/math4mad/32/49486_2.png) [@math4mad](https://discourse.julialang.org/u/math4mad)\
**Post date:** [May 20, 2023, 5:43am UTC](https://discourse.julialang.org/t/radial-basis-functions-in-surrogates-jl/99144/2 "2023-05-20T05:43:06Z")

</div>

Surrogates.jl is a high level package based on Gaussian Process.

Gaussian Process suppose your data sampling from a MVNormal,so params just mean vector and covariance matrix.in GP these called mean function and covariance function .  
**when we use data to build covariance matrix ,we can map data from data space to feature space or empirical space**.

Why we need map data to higher dimension space? Maybe our observing data just some higher dimension data embedding in our real word. you can think there are some latent data generate machines(in higher dimension) to produce our data, and these machine defining by mean vector and covariance matrix.  
so we need mathematics methods to search these data generate machine’s params

`kernel function` or `kernel tricks` are function to mapping data to feature space or empirical space.

different kernel function mapping data to different feature space. That’s point!

In short ,it’s powerful, statistical and mathematical.please reference

1. [Kernel Functions](https://juliagaussianprocesses.github.io/KernelFunctions.jl/stable/)
2. [Kernel Methods and Machine Learning](https://www.cambridge.org/core/books/kernel-methods-and-machine-learning/4B52092A98E1553A26EB5271D832D29E)
3. [GaussianProcesses.jl](https://stor-i.github.io/GaussianProcesses.jl/latest/)
4. [Augmented and Normal Gaussian Processes](https://theogf.dev/AugmentedGaussianProcesses.jl/dev/)
5. [Gaussian Process Modeling, Design, and Optimization for the Applied Sciences](https://www.taylorfrancis.com/books/mono/10.1201/9780367815493/surrogates-robert-gramacy)
6. [Gaussian Processes for Machine Learning](http://gaussianprocess.org/gpml/)

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [May 20, 2023, 12:55pm UTC](https://discourse.julialang.org/t/radial-basis-functions-in-surrogates-jl/99144/3 "2023-05-20T12:55:40Z")

</div>

> [@rkube](#):
>
> I’m trying to understand what RBFs Surrogates.jl is using. For example, the [documentation](https://docs.sciml.ai/Surrogates/stable/surrogate/) only specifies that it uses `RadialBasis` . The [code] specifies that there is a `linearRadial` and `cubicRadial`. What equation is used as the surrogate?

It doesn’t seem to be documented, but the `RadialBasis` constructor takes a keyword argument `rad` to specify the type of radial-basis function, which [defaults to `linearRadial`](https://github.com/SciML/Surrogates.jl/blob/f0873c3f65a1da14b14a1eb3a8d28de9a594a6ee/src/Radials.jl#L37-L38): what Wikipedia calls a “polyharmonic spline” of degree 1. You could easily define your own surrogate based on the [examples in Surrogates.jl](https://github.com/SciML/Surrogates.jl/blob/f0873c3f65a1da14b14a1eb3a8d28de9a594a6ee/src/Radials.jl#L23-L30).

> [@math4mad](#):
>
> Surrogates.jl is a high level package based on Gaussian Process.

(This answer doesn’t make any sense.)

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 21, 2023, 3:06pm UTC](https://discourse.julialang.org/t/radial-basis-functions-in-surrogates-jl/99144/4 "2023-05-21T15:06:03Z")

</div>

> [@stevengj](#):
>
> (This answer doesn’t make any sense.)

Whomever that is might’ve just used ChatGPT haha. Yeah what the heck is that one.

We should document this part though. @rkube could you please open an issue so it gets tracked? Thanks.

---

<div class="post-metadata">

**Author:** ![rkube](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rkube/32/211198_2.png) [@rkube](https://discourse.julialang.org/u/rkube)\
**Post date:** [May 21, 2023, 9:47pm UTC](https://discourse.julialang.org/t/radial-basis-functions-in-surrogates-jl/99144/5 "2023-05-21T21:47:54Z")

</div>

Sure

> <https://github.com/SciML/Surrogates.jl/pull/433>
