RBF Test Functions¶
ferreus_rbf.RBFTestFunctions
¶
Various RBF test functions.
3D test functions f1_3d-f8_3d are implemented from [1].
References¶
- Bozzini, Mira & Rossini, Milvia. (2002). Testing methods for 3D scattered data interpolation. 20, 111-135.
franke_2d(xy)
classmethod
¶
Franke's two-dimensional test function:
\[
\begin{aligned}
F(x,y) &=
\tfrac{3}{4}\exp\!\left[
-\frac{(9x-2)^2 + (9y-2)^2}{4}
\right] \\[6pt]
&\quad+ \tfrac{3}{4}\exp\!\left[
-\frac{(9x+1)^2}{49}
-\frac{(9y+1)^2}{10}
\right] \\[6pt]
&\quad+ \tfrac{1}{2}\exp\!\left[
-\frac{(9x-7)^2 + (9y-3)^2}{4}
\right] \\[6pt]
&\quad- \tfrac{1}{5}\exp\!\left[
-(9x-4)^2 - (9y-7)^2
\right]
\end{aligned}
\]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xy
|
(N, 2) float64 ndarray
|
Points in the unit square |
required |
Returns:
| Type | Description |
|---|---|
(N, 1) float64 ndarray
|
Function values at the input points. |
f1_3d(xyz)
classmethod
¶
3D Franke-like test function:
\[
\begin{aligned}
F(x,y,z) &=
\tfrac{3}{4}\exp\!\left[
-\frac{(9x-2)^2 + (9y-2)^2 + (9z-2)^2}{4}
\right] \\[6pt]
&\quad+ \tfrac{3}{4}\exp\!\left[
-\frac{(9x+1)^2}{49}
-\frac{(9y+1)^2}{10}
-\frac{(9z+1)^2}{10}
\right] \\[6pt]
&\quad+ \tfrac{1}{2}\exp\!\left[
-\frac{(9x-7)^2 + (9y-3)^2 + (9z-5)^2}{4}
\right] \\[6pt]
&\quad- \tfrac{1}{5}\exp\!\left[
-(9x-4)^2 - (9y-7)^2 - (9z-5)^2
\right]
\end{aligned}
\]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyz
|
(N, 3) float64 ndarray
|
Points in the unit cube |
required |
Returns:
| Type | Description |
|---|---|
(N, 1) float64 ndarray
|
Function values at the input points. |
f2_3d(xyz)
classmethod
¶
\[
F(x,y,z) =
\frac{
\tanh(9z - 9x - 9y) + 1
}{
9
}
\]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyz
|
(N, 3) float64 ndarray
|
Points in the unit cube |
required |
Returns:
| Type | Description |
|---|---|
(N, 1) float64 ndarray
|
|
f3_3d(xyz)
classmethod
¶
\[
F(x,y,z) =
\frac{
\cos(6z)\,\bigl(1.25 + \cos(5.4y)\bigr)
}{
6 + 6(3x - 1)^2
}
\]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyz
|
(N, 3) float64 ndarray
|
Points in the unit cube |
required |
Returns:
| Type | Description |
|---|---|
(N, 1) float64 ndarray
|
|
f4_3d(xyz)
classmethod
¶
\[
F(x,y,z) =
\frac{1}{3}\,
\exp\!\left[
-\frac{81}{16}
\bigl(
(x-\tfrac{1}{2})^2 +
(y-\tfrac{1}{2})^2 +
(z-\tfrac{1}{2})^2
\bigr)
\right]
\]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyz
|
(N, 3) float64 ndarray
|
Points in the unit cube |
required |
Returns:
| Type | Description |
|---|---|
(N, 1) float64 ndarray
|
|
f5_3d(xyz)
classmethod
¶
\[
F(x,y,z) =
\frac{1}{3}\,
\exp\!\left[
-\frac{81}{4}
\bigl(
(x-\tfrac{1}{2})^2 +
(y-\tfrac{1}{2})^2 +
(z-\tfrac{1}{2})^2
\bigr)
\right]
\]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyz
|
(N, 3) float64 ndarray
|
Points in the unit cube |
required |
Returns:
| Type | Description |
|---|---|
(N, 1) float64 ndarray
|
|
f6_3d(xyz)
classmethod
¶
\[
F(x,y,z) =
\frac{
\sqrt{
64 -
81\bigl[
(x-\tfrac{1}{2})^2 +
(y-\tfrac{1}{2})^2 +
(z-\tfrac{1}{2})^2
\bigr]
}
}{
9
}
- \tfrac{1}{2}
\]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyz
|
(N, 3) float64 ndarray
|
Points in the unit cube |
required |
Returns:
| Type | Description |
|---|---|
(N, 1) float64 ndarray
|
|
f7_3d(xyz)
classmethod
¶
Sigmoidal test function:
\[
F(x,y,z) =
\frac{
1
}{
\sqrt{
1 + 2\exp\!\bigl(
-3\bigl(\sqrt{x^2 + y^2 + z^2} - 6.7\bigr)
\bigr)
}
}
\]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyz
|
(N, 3) float64 ndarray
|
Points in the unit cube |
required |
Returns:
| Type | Description |
|---|---|
(N, 1) float64 ndarray
|
|
f8_3d(xyz)
classmethod
¶
Peak function (independent of z):
\[
\begin{aligned}
F(x,y,z) &=
50\,\exp\!\left[
-200\bigl((x-0.3)^2 + (y-0.3)^2\bigr)
\right] \\[6pt]
&\quad+ \exp\!\left[
-50\bigl((x-0.5)^2 + (y-0.5)^2\bigr)
\right]
\end{aligned}
\]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyz
|
(N, 3) float64 ndarray
|
Points in the unit cube |
required |
Returns:
| Type | Description |
|---|---|
(N, 1) float64 ndarray
|
|