An Algorithm For Choosing Best Shape Parameter For
An Algorithm For Choosing Best Shape Parameter For
Abstract: Radial Basis Function (RBF) is a real valued function whose value rests only on the distance from
some other points called a center, so that a linear combination of radial basis functions are typically used
to approximate given functions or differential equations. Radial Basis Function (RBF) approximation has
the ability to give an accurate approximation for large data sites which gives smooth solution for a given
number of knots points; particularly, when the RBFs are scaled to the nearly flat and the shape parameter
is chosen wisely. In this research work, an algorithm for solving partial differential equations is written and
implemented on some selected problems, inverse multiquadric (IMQ) function was considered among other
RBFs. Preference is given to the choice of shape parameter, which need to be wisely chosen. The strategy
is written as an algorithm to perform number of interpolation experiments by changing the interval of the
shape parameters and consequently select the best shape parameter that give small root means square error
(RMSE). All the computational work has been done using Matlab. The interpolant for the selected problems
and its corresponding root means square errors (RMSEs) are tabulated and plotted.
Keywords: Radial basis function (RBF), partial differential equations (PDE), inverse multiquadric (IMQ), root
means square error (RMSE).
1. Introduction
BF is an important method for approximating and interpolating functions and solving differential
R equations (both ordinary and partial) for data with scattered node locations and in computation
domain in higher dimensions as discussed in [1]. RBF methods were first introduced by [2], who was a
geodesist at Iowa State University. In his proposed method, he simplified the computation of scattered data
problem relative to the previously used polynomial interpolation. In many cases, RBF methods have been
proved to be effective, where polynomial interpolation fails. RBF method are often used in topographical
representation and other intricate 3D shapes.
The use of RBF to interpolate scattered data problem emanated from the fact that the interpolation
problem becomes insensitive to the dimension (d) of the space in which the data set lies. Recently, different RBF
based methods have gained attention in scientific, computing and engineering applications such as functions
interpolation [3,4], numerical solutions to partial differential equation (PDEs) [5–7], Multivariate scattered
data processing [8] and so on. The main advantages of this method are spectral convergence rates that can be
achieved using infinitely smooth basis functions, geometrical flexibility and ease of implementation [3,9].
Due to the quadric surface, Hardy termed his method multiquadric. The MQ transformed scattered data to
a very accurate fit model of graph or surface. Subsequently he considered the MQ as a consistent solution of
biharmonic solution [10] to physically demonstrate its bravery. Other researchers like [11] extensively tested
twenty-nine different algorithms on the typical benchmark function on interpolation problems and ranked
the MQ-RBF and thin-plate splines TPS-RBF (introduced in [12] via employing the minimum bending energy
theory of the surface of a thin plate) as top two candidates based on the following criteria: timing, storage,
accuracy, visual pleasantness of the surface, and ease of implementation. Following the success recorded on
researches, RBFs have become popular in the scientific computing world, such as computer graphics, data
processing, and economics.
In 1986, Charles Micchelli developed the theory behind the MQ method, and proved that the MQ method
matrix system is invertible [13]. Few years later, [14,15] a collocating method was derived for solving partial
differential equations using MQ. The breakthrough by Kansa triggered a research boom in RBF. The Kansa
method is meshless and superior to the classical method due to some advantages such as: integration-free,
ease of implementation and superior convergence. In addition, it may be of interest that even before Kansa’s
pioneer work, Nardini and Brebbia (1983) [16] applied the function 1 + r without prior knowledge of RBFs
as the basis function in the Dual Reciprocity Method (DRM) in the context of the boundary element methods
(BEM) to get rid of domain integral effectively. Over the years, several researchers proposed different methods
which include:
1. Rescaled localized radia basis function interpolation on non-cartesian and nonconforming grids [4],
2. Dual Reciprocity Method (DRM) [17],
3. Method of Fundamental Solutions (MFS) [18], also known as the regular BEM.
4. Radial integration Method [19],
5. Monte Carlo Method [20],
6. Multiple reciprocity method (MRM) [21].
ρ f ( x j ) = f ( x j ) j = 1, . . . Υ , (2)
Ab = f =⇒ b = A−1 f , (3)
ϕ(k x1 − x1 k) ... ϕ(k x1 − x N k)
ϕ(k x2 − x1 k) ... ϕ(k x2 − x N k)
A= .. .. . (4)
. ... .
ϕ(k x N − x1 k) ... ϕ(k x N − x N k)
N
ρ f (λ j ) = ∑ ak ϕ(kλ j − xk k2 ), j = 1, . . . , Φ . (5)
k =1
3. Methodology
To have a better knowledge of how the parameter e changes the shape of a function, we present the
following theorem of strictly positive definite (SPD) functions [25,26]:
In summary, it can be deduced from the above theorem that − ϕ(0) < ϕ( x ) < ϕ(0). Consider
Since we are considering basis functions that are strictly positive definite (SPD ): IMQ, Wedland and
Gaussian, the Theorem 1 gives new bounds as seen in Equation (6).
Note that φ(e; r ) = φ(1; e; r ). If we take these radial basis as φ(e; r ), as a result, the bounds explain how
e would behave on the shape of the function. i.e, increment in the value of e leads to a continuous alter of the
shape of the function to a spiky shape as shown in Figure 1, where the spike is denoted by φ(0). Conversely
decrements in the value of an e leads to a continuous change in the shape of the function to a flat shape, having
limit at φ(0) as well, see Figure 1 for explanation.
Open J. Math. Sci. 2020, 4, 147-157 150
Earlier in this section, we mentioned the role of the shape parameter (e). Several researchers worked in
this direction [3,22–24] but only few have discussed the role of shape parameter on the accuracy and shape of
the interpolant. Numerous articles and books have been dedicated to explain how vital e is to determine the
shape of a radial function therefore it is obvious that the shape parameter play a vital role in the accuracy and
the shape of an interpolant, therefore, the shape parameter need to be chosen wisely.
The question is: how can we choose the optimal shape parameter e∗ with least root mean square error
(RMSE)? The answer of this question will be discussed later in this section.
In an attempt to determine the interval in which the optimal shape parameter exists, different algorithms
have been provided by different researchers but the purpose of this research work is to provide a Trial and
Error algorithm. This algorithm explain explicitly the effect of shape parameter e on the the solution of PDE
problems selected for interpolation and narrows the interval in which the optimal shape parameter e∗ is obtain.
This algorithm will be discussed in Subsection 3.2.
It can be observed that the lower values of e result in a ( f latter ) basis function and the higher values of e
result in a (spikier ) basis functions and e = 0 result to constant basis functions. Accuracy and stability are major
concerns in numerical computations. It is well known that instability increases as e decreases. The significance
of this statement lies in the fact that highest accuracy is often found at some small shape parameters, which
may be in an unstable region. "Trade-off principle" is the term used to denote the conflict between accuracy
and numerical stability [25]. The choice of the basis function is linked with this "trade-off principle". Recently,
different methods have been introduced to stably compute interpolants with small parameters by using an
alternate basis, such as Contour-Pade and RBF-QR, as in [30] and [31].
Trial and Error Algorithm: To use Trial and Error algorithm, the PDE problems must be transform to
matrix form i.e., Ab = f , the generating data must be known [29]. If the function to be interpolate is unknown,
it becomes very difficult to choose the best shape parameter. One of the easiest way to choose (e∗ ) is to
perform a series of interpolation experiments on a large range of shape parameters then narrow it down to
Open J. Math. Sci. 2020, 4, 147-157 151
some selected shape parameters relative to least RMSE. Trial and Error algorithm enhances the clarification
effectively on how shape parameter acts on solution of the PDE problems and gives an insight on how to
narrow the interval of e.
This scheme works only when the problem to be interpolated is known. We have the Algorithm 1:
4. Illustrative examples
In this section, the Trial and Error algorithm has been employed on some selected PDE problems in R2
using inverse multiquadric (IMQ) RBF with evaluation points M = 1600 and with different knots N by letting
Ω = [0, 1]2 . The Root Mean Square Error is calculated by the formula given in (7).
Example 1. Consider
∂2 u ∂2 u
− 2 + u( x, y) = 2 sin x, ( x, y) ∈ [0, 1]2 (8)
∂y2 ∂x
with boundary condition u(1, y) = sin(1) + sin(y), and exact solution u( x, y) = sin x + sin y.
Applying the Algorithm 1, rewriting Equation (8) in the form of Equation (1) and solving the resulting
equation together with the attached conditions, we obtain the interpolant. RMSE for Example 1 at different
data sites are tabulated in Table 2 and its corresponding figure is shown in Figure 2. Figure 3 correspond to
column 1 of Table 6.
Example 2. Consider
∂u ∂2 u (1 + y)2 exp( x )
− 2 + u( x, y) = − , ( x, y) ∈ [0, 1]2 (9)
∂y ∂x (1 + y2 )2
1 exp( x )
with boundary condition u( x, 0) = exp( x ), u(0, y) = 1+ y2
, and exact solution u( x, y) =
.
1 + y2
Table 3 presents the RMSE for different data sites which correspond to Figure 4. The shape parameter that
best fits the problem is tabulated in Table 6 and its corresponding figure is shown in Figure 5.
∂2 u
= 4x + e x , ( x, y) ∈ [0, 1] × [0, 1]
∂x∂y
∂u(0, y)
with supplementary conditions = y, y ∈ [0, 1], and u( x, 0) = 2, x ∈ [0, 1]. The exact solution of this
∂y
y2
problem is u( x, y) = 2x2 y + ye x + 2 − y + 2.
Open J. Math. Sci. 2020, 4, 147-157 153
Figure 5. The approximate solution for Example 2 and its corresponding RMSE for different n
Table 4 presents the RMSE for different data sites which correspond to Figure 6. The shape parameter that
best fits the problem is tabulated in Table 6 and its corresponding figure is shown in Figure 7.
with boundary conditions u( x, 0) = u( x, 1) = u(0, y) = u(1, y). The exact solution is u( x, y) = 16x (1 − x )y(1 −
y ).
Table 5 presents the RMSE for different data sites which correspond to Figure 8. The shape parameter that
best fits the problem is tabulated in Table 6 and its corresponding figure is shown in Figure 9.
Open J. Math. Sci. 2020, 4, 147-157 154
Table 6. RMSE for the examples considered with their respective optimal shape parameter (e∗ )
Data sites Example 1 e∗ = 0.4 Example 2 e∗ = 1.6 Example 3 e∗ = 0.72 Example 4 e∗ = 2.4
9 7.061068e-04 8.599953e-02 4.409283e+13 3.417120e-01
25 1.233554e-04 2.100864e-02 2.546641e+10 8.421439e-02
81 1.916602e-06 1.977596e-03 1.349606e+04 1.434081e-02
289 3.628324e-06 2.620360e-05 1.632955e-05 7.800962e-04
1089 1.588367e-06 2.699984e-06 1.951918e-05 3.327200e-06
4225 6.143375e-06 6.386367e-06 3.725997e-05 9.814452e-06
5.2. Conclusion
In this research work, Trial and Error scheme is proposed to determine the range in which the best
shape parameter e∗ lies via IMQ radial function by performing interpolation experiments and selecting
which experiment produces the least RMSE for different data sites. We have illustrated the formulation and
implementation of this process on some selected PDE problems. Obviously, numerical results demonstrated
that the scheme alongside the Matlab codes has immensely reduced time and ease the complexity involved in
Open J. Math. Sci. 2020, 4, 147-157 156
the computation, thus, making this scheme an effective and efficient technique for solving partial differential
equations.
Acknowledgments: The authors wishes to express his profound gratitude to the reviewers for their useful comments on
the manuscript.
Author Contributions: All authors contributed equally to the writing of this paper. All authors read and approved the
final manuscript.
Conflicts of Interest: "The authors declare no conflict of interest."
References
[1] Larsson, E., Lehto, E., Heryudono, A. & Fornberg, B. (2013). Stable computation of differentiation matrices and
scattered node stencils based on Gaussian radial basis functions. SIAM Journal on Scientific Computing, 35(4),
A2096-A2119.
[2] Hardy, R. L. (1971). Multiquadric equations of topography and other irregular surfaces. Journal of geophysical research,
76(8), 1905-1915.
[3] Biazar, J. & Hosami, M. (2016). Selection of an interval for variable shape parameter in approximation by radial basis
functions. Advances in Numerical Analysis, 2016.
[4] Deparis, S., Forti, D. & Quarteroni, A. (2014). A rescaled localized radial basis function interpolation on non-Cartesian
and nonconforming grids. SIAM Journal on Scientific Computing, 36(6), A2745-A2762.
[5] Fedoseyev, A. I., Friedman, M. J. & Kansa, E. J. (2002). Improved multiquadric method for elliptic partial differential
equations via PDE collocation on the boundary. Computers & Mathematics with Applications, 43(3-5), 439-455.
[6] Sarra, S. A. & Kansa, E. J. (2009). Multiquadric radial basis function approximation methods for the numerical solution
of partial differential equations. Advances in Computational Mechanics, 2(2).
[7] Dehghan, M. & Shokri, A. (2009). Numerical solution of the nonlinear KleinŰGordon equation using radial basis
functions. Journal of Computational and Applied Mathematics, 230(2), 400-410.
[8] Iske, A. (2002). Scattered data modelling using radial basis functions. In Tutorials on Multiresolution in Geometric
Modelling (pp. 205-242). Springer, Berlin, Heidelberg.
[9] Kansa, E. J. & Carlson, R. E. (1992). Improved accuracy of multiquadric interpolation using variable shape parameters.
Computers & Mathematics with Applications, 24(12), 99-120.
[10] Hardy, R. L. (1990). Theory and applications of the multiquadric-biharmonic method 20 years of discovery 1968Ű1988.
Computers & Mathematics with Applications, 19(8-9), 163-208.
[11] Franke, R. (1982). Scattered data interpolation: tests of some methods. Mathematics of computation, 38(157), 181-200.
[12] Duchon, J. (1977). Splines minimizing rotation-invariant semi-norms in Sobolev spaces. In Constructive theory of
functions of several variables (pp. 85-100). Springer, Berlin, Heidelberg.
[13] Micchelli, C. A. (1984). Interpolation of scattered data: distance matrices and conditionally positive definite functions.
In Approximation theory and spline functions (pp. 143-145). Springer, Dordrecht.
[14] Kansa, E. J. (1990). Multiquadrics–A scattered data approximation scheme with applications to computational
fluid–dynamics–I surface approximations and partial derivative estimates. Computers & Mathematics with applications,
19(8–9), 127–145.
[15] Kansa, E. J. (1990). Multiquadrics–A scattered data approximation scheme with applications to computational
fluid–dynamics–II solutions to parabolic, hyperbolic and elliptic partial differential equations. Computers &
mathematics with applications, 19(8–9), 147–161.
[16] Nardini, D. & Brebbia, C. A. (1983). A new approach to free vibration analysis using boundary elements. Applied
mathematical modelling, 7(3), 157-162.
[17] Partridge, P. W. & Brebbia, C. A. (Eds.). (2012). Dual reciprocity boundary element method. Springer Science & Business
Media.
[18] Kupradze, V. D. & Aleksidze, M. A. (1964). The method of functional equations for the approximate solution of certain
boundary value problems. USSR Computational Mathematics and Mathematical Physics, 4(4), 82-126.
[19] Gao, X. W. (2006). A meshless BEM for isotropic heat conduction problems with heat generation and spatially varying
conductivity. International journal for numerical methods in engineering, 66(9), 1411-1431.
[20] Chen, C. S., Golberg, M. A. & Hon, Y. C. (1998). The method of fundamental solutions and quasi-Monte-Carlo method
for diffusion equations. International Journal for Numerical Methods in Engineering, 43(8), 1421-1435.
[21] Nowak, A. J. & Partridge, P. W. (1992). Comparison of the dual reciprocity and the multiple reciprocity methods.
Engineering analysis with boundary elements, 10(2), 155-160.
[22] Sarra, S. A. & Sturgill, D. (2009). A random variable shape parameter strategy for radial basis function approximation
methods. Engineering Analysis with Boundary Elements, 33(11), 1239-1245.
Open J. Math. Sci. 2020, 4, 147-157 157
[23] Xiang, S., Wang, K. M., Ai, Y. T., Sha, Y. D. & Shi, H. (2012). Trigonometric variable shape parameter and exponent
strategy for generalized multiquadric radial basis function approximation. Applied Mathematical Modelling, 36(5),
1931-1938.
[24] Mongillo, M. (2011). Choosing basis functions and shape parameters for radial basis function methods. SIAM
undergraduate research online, 4(190-209), 2-6.
[25] Fasshauer, G. E. (2007). Meshfree approximation methods with MATLAB (Vol. 6). World Scientific.
[26] Wilkins, M. F., Boddy, L., Morris, C. W. & Jonker, R. (1996). A comparison of some neural and non-neural methods for
identification of phytoplankton from flow cytomery data. Bioinformatics, 12(1), 9-18.
[27] Rippa, S. (1999). An algorithm for selecting a good value for the parameter c in radial basis function interpolation.
Advances in Computational Mathematics, 11(2-3), 193-210.
[28] Wright, G. B. (2003). Radial basis function interpolation: numerical and analytical developments.
[29] Wright, G. B. & Fornberg, B. (2006). Scattered node compact finite difference-type formulas generated from radial
basis functions. Journal of Computational Physics, 212(1), 99-123.
[30] Fornberg, B. & Wright, G. (2004). Stable computation of multiquadric interpolants for all values of the shape
parameter. Computers & Mathematics with Applications, 48(5-6), 853-867.
[31] Piret, C. (2007). Analytical and numerical advances in radial basis functions. Ph. D. thesis.
[32] Ngai, S. C. (2004). Numerical Solution of Partial Differential Equations with the Tau-Collocation Method. City University of
Hong Kong.
c 2020 by the authors; licensee PSRP, Lahore, Pakistan. This article is an open access article
distributed under the terms and conditions of the Creative Commons Attribution (CC-BY) license
(http://creativecommons.org/licenses/by/4.0/).