Local Splines and the Least Squares Method
I. G. BUROVA
The Department of Computational Mathematics,
St. Petersburg State University,
7-8 Universitetskaya Embankment, St.Petersburg,
RUSSIA
Abstract: - The least squares method is widely used in processing quantitative results of natural science
experiments, technical data, astronomical and geodetic observations and measurements. This paper proposes
the construction of a modified least squares method based on the use of basis splines of a non-zero level. This
modification allows us to obtain a continuously differentiable (required number of times) solution to the
problem. The resulting solution is convenient to use to further solve other related problems. The construction of
a continuously differentiable solution and a twice continuously differentiable solution is considered in more
detail. These solutions are constructed based on the use of basis Hermitian splines of the fourth and sixth orders
of approximation. The numerical results are presented for processing inaccurately specified experimental data,
as well as for smoothing curves.
Key-Words: - polynomial splines, cubic splines, linear splines, least squares method, Hermitian splines,
Lagrangian splines, fourth order approximation, second order approximation.
Received: January 25, 2024. Revised: March 2, 2024. Accepted: May 3, 2024. Published: June 17, 2024.
1 Introduction
As is known, if a large number of interpolation
nodes is unsuccessfully selected, the approximation
error can be catastrophically large. Improving the
quality of approximation can be achieved in
different ways. One of these methods is the least
squares method.
The specifics of applying the least squares
method are described in many books, [1]. In a lot of
research papers the least squares method is used to
solve various practical problems, for example,
channel estimation in wireless systems, [2]. As is
noted in this paper, “accurate channel estimation is
the key factor to improving the receiver quality”.
Based on the least squares method, various
algorithms may be constructed. For example, in
paper [3], a least mean square based algorithm is
proposed to estimate the phase noise.
In paper [4], it was shown that through the partial
least square equation modeling, the big data
analytics capability affects the organizational agility
and firm performance positively. In paper [5], the
robust filtering problem is introduced based on the
minimization of the mean-square value of the
filtering errors for the system states. Paper [6],
discovers a link between an insurance company's
initial capital and the likelihood of ruin. The least
squares regression method is utilized to calculate the
minimum initial capital, and the simulation
approach would be used to determine the ruin
probability.
Many authors use splines and least squares method
in their research, [7]. The B-spline is often used
when we solve such problems. Note, that papers [8],
[9] use B-splines.
The least squares minimization method is
involved in study [10] to calculate control points to
minimize the approximation error.
The least squares method and B-splines were
used in [11] to solve a nonlinear problem in fluid
dynamics using the Navier–Stokes equations as a
mathematical model.
The purpose of the paper [12] is to show the results
of a study focused on the occurrence of damage
heterogeneous materials, especially on the issue of
modelling crack formation and propagation.
In paper [13], the authors estimated the spatial
pattern and temporal trend of the resilience of
subtropical evergreen forests in China.
Paper [14], presents an original approach to
generate a 2D high detail riverbed based on a drone
photogrammetric survey.
Monograph [15], discusses the use of quadratic
splines for constructing a mean-square
approximation.
In this paper, we use the local splines of the
Lagrangian splines and the Hermitian splines to
construct a mean-square approximation.
WSEAS TRANSACTIONS on SYSTEMS
DOI: 10.37394/23202.2024.23.21
I. G. Burova
E-ISSN: 2224-2678
188
Volume 23, 2024
1.1 Some Information
In various practical cases we are often given grid
(tabular) functions (󰇜 at the
equidistant set of nodes 󰇝󰇞. So, for example, the
grid functions are obtained during experimental
studies. The grid functions are often specified when
designing structural elements. So, at the grid nodes
 the values of the function () are
known. But sometimes in addition to the values of
the function (), the values of the first derivative
of this function at the nodes, are known. And it is
also possible that in addition to the values of the
function (), the values of the first and the second
derivatives of this function at the nodes, are known.
It is required to carry out a continuous or
continuously differentiable function passing through
the given points.
Very often, the input data has measurement errors.
In this case, it is required to draw a continuous or
continuously differentiable function passing close to
the given points.
Different smoothing methods are known.
Smoothing methods are used if the input data has
measurement errors. Typically, two main methods
are used to solve this problem: the least squares
method (best mean square approximation method)
and the best integral approximation method.
In this case, the algebraic polynomials
󰇛󰇜
 
where are coefficients, 󰇛󰇜 or the
generalized polynomials
󰆻󰇛󰇜󰇛󰇜

are often used. We can take 󰇛󰇜 as the algebraic
polynomials. In the case , ,
we have the Lagrange interpolation. When
constructing smoothing approximations, we use one
of the following conditions:
󰇡󰆻󰇛󰇜󰇛󰇜󰇢
 
󰇛󰇜
or 󰆻󰇛󰇜

,
where
󰇛󰇜

.
The least squares method is a variational
method. Variational methods are based on the fact
that the problem of solving an equation is reduced to
the problem of finding the minimum of a certain
function.
The minimum in (1) is achieved if
󰇡󰆻󰇛󰇜󰇛󰇜󰇢
 
The extremum conditions are as follows


As a result, we obtain a system of equations. Using
the scalar product
󰇛󰇜
 󰇛󰇜
we write the system in the form
󰇛󰇜󰇛󰇜󰇛󰇜
󰇛󰇜, 
where 󰇛󰇜󰇛󰇜
 󰇛󰇜
The determinant of the system is symmetric. If
the basis functions are linearly independent, then the
determinant of the system is not equal to zero.
Therefore, the solution to the system exists and is
unique. This determinant is called the Gram
determinant.
In this paper, we consider the use of local spline
approximations to construct smoothing curves. This
problem arises, for example, if the input data is
given with errors or we want to construct a smooth
line using a given line. In the case of using local
splines of a non-zero level, we can also obtain the
restoration and smoothing of the derivatives. The
results of using continuously differentiable splines
of the first level, as well as twice continuously
differentiable splines of the second level are used.
Section 3 presents the results of the numerical
experiments.
WSEAS TRANSACTIONS on SYSTEMS
DOI: 10.37394/23202.2024.23.21
I. G. Burova
E-ISSN: 2224-2678
189
Volume 23, 2024
1.2 Lagrangian Splines and Hermitian
Splines
First, we discuss splines of a zero level
(Lagrangian splines) and a non-zero level
(Hermitian splines).
Let an ordered grid of nodes be constructed on the
interval 󰇟󰇠

Local spline approximations on each grid
interval 󰇟󰇠 are constructed as the sum of the
products of the values of the function and its
derivatives at the grid nodes and the basis splines of
a non-zero level. By level we mean the maximum
value of the derivatives of the functions included in
the approximation. Splines of the non-zero level can
have the basis splines with narrow and wide
support, [16]. The supports of the basis splines with
narrow support occupy two grid intervals. In paper
[16], spline approximations 󰇛󰇜 with a narrow
support of the following form were considered
󰇛󰇜 󰇛󰇜
 󰇛󰇜󰇟󰇠
We determine the basis splines from the
relations
󰇛󰇜󰇛󰇜
󰇟󰇠
In this case, the approximation is said to be exact
on polynomials of degree at most m. The
approximation theorem is proved, [17]:
󰇛󰇜󰇛󰇜
here is a constant, and is called the order
of approximation. A distinctive feature of these
splines is that their construction does not require
solving systems of linear algebraic equations.
Therefore, the construction of approximations can
be carried out in real time on an infinite grid of
nodes and on a finite grid of nodes on the interval
󰇟󰇠
󰇛󰇜󰇛󰇜
󰇟󰇠
The basis splines 󰇛󰇜 turn out to be α times
continuously differentiable local functions and
satisfy the conditions 
󰇛󰇜󰇛󰇜. Here ,
 the Kronecker symbols. Thus, the piecewise
given function
󰇛󰇜 coinciding on each grid interval
with the function 󰇛󰇜, turns out to be a Hermite
interpolation, interpolating the function at the grid
nodes. As is known, if a large number of
interpolation nodes is unsuccessfully selected, the
approximation error can be catastrophically large.
Improving the quality of approximation can be
achieved in different ways.
2 Smoothing Methods Construction
Suppose, the values of the function is given at the
nodes 󰇝󰇞. In the simplest case, the grid of nodes
󰇝󰇞 is given with step 󰇛󰇜
.

Suppose, experimental data (󰇜 has measurement
errors :
(󰇜.
We construct the smoothing curve in two stages.
First, we connect the points with a piecewise line
using the basis splines of the second order of
approximation
󰇛󰇜

󰇛󰇜

On each interval  we construct 󰇛󰇜:
󰇛󰇜󰇛󰇜󰇛󰇜
.
If the function 󰇟󰇠, then the
estimate is valid
󰇛󰇜󰇛󰇜
󰇛󰇜󰇟󰇠
Here  .
Now we get the piecewise function 󰇛󰇜
󰇟󰇠
󰇛󰇜󰇱󰇛󰇜 󰇟󰇠
󰇛󰇜 󰇟󰇠
The error of approximation with such splines in the
general case is given in the author’s paper, [3].
Example 1. Let . The values of the
function at nodes are given as shown in Figure
1.
When the points using second-order
approximation splines are connected, we get the
continuous piecewise function (Figure 2)
WSEAS TRANSACTIONS on SYSTEMS
DOI: 10.37394/23202.2024.23.21
I. G. Burova
E-ISSN: 2224-2678
190
Volume 23, 2024
Fig. 1: The values of function
Fig. 2: The continuous piecewise function after
connecting the points using the second-order
approximation splines
2.1 Construction of Basis Splines of the
Fourth Order of Approximation of the
First Level
Let a sparse grid of nodes 
also be given as follows

Let us assume that at each grid node the
values of the function 󰇛󰇜 and its first derivative
are known.
In this case, we construct an approximation of
function 󰇛󰇜, 󰇟󰇠 in the form
󰇛󰇜 󰇛
 󰇜󰇛󰇜󰇛󰇜󰇛󰇜
We assume that supp =supp 
󰇟󰇠. Let the basis functions be determined
from the conditions

From these conditions on the interval 󰇟󰇠
we obtain a system of equations for determining the
basis functions
󰇛󰇜󰇛󰇜
󰇛󰇜󰇛󰇜󰇛󰇜󰇛󰇜

󰇛󰇜
󰇛󰇜󰇛󰇜
󰇛󰇜
󰇛󰇜
󰇛󰇜󰇛󰇜

󰇛󰇜
The basis splines of the first level have the form
󰇛󰇜


󰇛󰇜


󰇛󰇜

󰇛󰇜

Now we get formulas for the approximation
function ,
󰇛󰇜󰇛󰇜󰇛󰇜󰇛󰇜󰇛󰇜
󰇛󰇜󰇛󰇜󰇛󰇜󰇛󰇜,

If the function 󰇟󰇠, then the
estimate is valid
󰇛󰇜󰇛󰇜󰇛󰇜󰇟󰇠
Here 
3 Construction of the Solution
To construct a continuously differentiable
smoothing curve, we use splines of the fourth order
of approximation of the first level.
To construct a twice continuously differentiable
smoothing curve, we use splines of the sixth order
of approximation of the second level.
3.1 Construction of the Twice Continuous
Smoothing Functions
On each interval 󰇟󰇠, we consider the
expression
with the basis splines of the fourth
order of approximation and the first level in the
form
󰇛󰇜 
 󰇛󰇜󰇛󰇜
WSEAS TRANSACTIONS on SYSTEMS
DOI: 10.37394/23202.2024.23.21
I. G. Burova
E-ISSN: 2224-2678
191
Volume 23, 2024
Next, we use the scalar production of the form
󰇛󰇜󰇛󰇜󰇛󰇜
We find the coefficients  by solving the system of
equations 
where is the Gram matrix
.
Let 
be an element of the matrix
, then

󰇛󰇜󰇛󰇜

󰇛󰇜󰇛󰇜

󰇛󰇜󰇛󰇜

󰇛󰇜󰇛󰇜
Let's construct the vector :
󰇛󰇜
Let be an element of the vector . Then
󰇛󰇜󰇛󰇜
󰇛󰇜󰇛󰇜
Let the grid nodes be equally spaced, that is,
. Then it is easy to calculate the
elements of the matrix M. Matrix consists of 4
block matrices: .
The non-zero elements of the matrix are as
follows: 











The remaining elements in this block are zeros.
The non-zero elements of the matrix are as
follows:







,




The remaining elements in this block are zeros.
The matrix is as follows .
The non-zero elements of the matrix are as
follows: 









The remaining elements are zero. Thus, all
blocks of the matrix have a tridiagonal structure
with identical elements on the diagonals (except for
the corner elements).
When , we get the values of the function
at the nodes (blue points) in Figure 3 and Figure 4.
In Figure 3 we also see the initial data (red points).
Fig. 3: The values of the function at the nodes (blue
points) and the initial data (red points)
Fig. 4: The values of the function at the nodes (blue
points)
WSEAS TRANSACTIONS on SYSTEMS
DOI: 10.37394/23202.2024.23.21
I. G. Burova
E-ISSN: 2224-2678
192
Volume 23, 2024
Fig. 5: The values of function (red line) and the
initial data (blue points)
When the found points with splines of the fourth
order of approximation of the first level are
connected, we obtain a continuously differentiable
function, shown in Figure 5 with the red line.
If the original function is given by some
expression, then this same method allows us to
easily construct a continuously differentiable
smoothing curve.
Example 2. Let the function 󰇛󰇜 be given by the
expression
󰇛󰇜󰇛󰇜󰇛
󰇜󰇛󰇜󰇛
󰇜󰇛󰇜
Fig. 6: The values of the result smooth function
(blue line) and the initial line (red line)
The initial line and the result smooth function are
shown in Figure 6.
3.2 Construction of the Twice Continuous
Smoothing Functions
Let the function be such that 󰇟󰇠 and{ 󰇞
be the set of nodes on 󰇟󰇠such that

Suppose that the support of the basis spline 
occupies two grid intervals supp 
.
For , consider the approximation
󰇛󰇜󰇛󰇜󰇛󰇜
󰆒󰇛󰇜󰆒󰇛󰇜
󰇛󰇜󰇛󰇜󰇛󰇜󰇛󰇜,

The plots of basis splines  are presented in
Figure 7, Figure 8 and Figure 9.
Fig. 7: The plot of the basis splines  (green line)
and  (red line)
Fig. 8: The plot of the basis splines  (green line)
and  (red line)
Fig. 9: The plot of the basis splines  (green line)
and  (red line)
Next, our task is to determine the coefficients
 in the expression
󰇛󰇜󰇛󰇜󰇛󰇜󰇛󰇜
󰇛󰇜
󰇛󰇜󰇛󰇜,

To calculate the coefficients, we create a system
of linear algebraic equations
 .
Matrix has a block form. It consists of 9
blocks Each block has a strip structure. We
calculate the elements of using scalar products.
Example 2. Let function 󰇛󰇜 be given by the
expression
󰇛󰇜󰇛󰇜󰇛󰇜
󰇛󰇜
Let . The initial line and the result smooth
function are shown in Figure 10.
WSEAS TRANSACTIONS on SYSTEMS
DOI: 10.37394/23202.2024.23.21
I. G. Burova
E-ISSN: 2224-2678
193
Volume 23, 2024
Fig. 10: The values of the result smooth function
(blue line) and the initial line (red line)
4 Conclusion
In this paper, we use the local splines of the
Lagrangian splines and the Hermitian splines to
construct a modification of the construction of a
mean-square approximation. The basis splines of a
non-zero level make it possible to construct m-times
continuously differentiable smoothing lines. The
details of the construction of the three times
continuous smoothing functions with the Hermitian
splines and the approximations with the non-
polynomial splines will be considered in the future.
Acknowledgement:
The authors are gratefully indebted to St. Petersburg
University for their financial support in the
preparation of this paper (ID 118437477), as well as
to a resource center for providing the Maple
package.
References:
[1] R.W.Hamming. Numerical Methods for
Scientists and Engineers,New York, San
Francisco, Toronto, London, 1962.
[2] Nisha Mary Joseph, Puttamadappa C. Highly
Accurate Technique for CO-OFDM Channel
Estimation Technique Using Extreme
Learning Machine (ELM), WSEAS
Transactions on Electronics, Vol. 14, 2023,
pp.7-23,
https://doi.org/10.37394/232017.2023.14.2.
[3] M. Bharti, Performance enhancement of
coherent optical OFDM system using LMS
algorithm, J. Telecommun. Inf. Technol., Vol.
1, No 2020, 2020, pp. 1–5.
[4] Muhamad Luqman Khalil, Norzalita Abd
Aziz, Ahmad Azmi M. Ariffin, Abdul Hafaz
Ngah, Big Data Analytics Capability and Firm
Performance in the Hotel Industry: The
Mediating Role of Organizational Agility,
WSEAS Transactions on Business and
Economics, Vol. 20, 2023, pp. 440-453,
https://doi.org/10.37394/23207.2023.20.40.
[5] Seiichi Nakamori, Robust Recursive Least-
Squares Wiener Filter for Linear Continuous
Time Uncertain Stochastic System, WSEAS
Transactions on Signal Processing, Vol. 19,
2023, pp.108-117,
https://doi.org/10.37394/232014.2023.19.12.
[6] Soontorn Boonta, Kanoktip Kotsamran,
Comparison of the Minimum Initial Capital of
Investment Discrete Time Surplus Process in
Case Separated Claims, WSEAS Transactions
on Business and Economics, Vol. 20, 2023,
pp. 1260-1267,
https://doi.org/10.37394/23207.2023.20.112.
[7] Betul Kan Kilinc, Semra Malkoc, A. Savas
Koparal, Berna Yazici, Using multivariate
adaptive regression splines to estimate
pollution in soil, International Journal of
Advanced and Applied Sciences, Vol.4, No2,
2017, pp 10-16.
[8] Juan Zapata and Ramon Ruiz, On Speckle
Noise Reduction in Medical Ultrasound
Images, Recent Advances in Signals and
Systems, 2009, pp.126-131.
[9] Tetsuzo Kuragano and Kazuhiro Kasono, B-
spline Curve Generation and Modification
based on Specified Radius of Curvature,
WSEAS Transactions on Information Science
and Applications, Issue 11, Vol. 5, November
2008, pp.1607-1617.
[10] Nur Azliana Azlin Ahmad Munir; Normi
Abdul Hadi; Mohd Agos Salim Nasir; Suhaila
Abd Halim, Modelling fruit outline using
cubic trigonometric spline, AIP Conf. Proc.
2905, 030006, 2024.
https://doi.org/10.1063/5.0172468.
[11] Maria Luminita Scutaru, Sohaib Guendaoui,
Ouadie Koubaiti, Lahcen El Ouadefli,
Abdeslam El Akkad, Ahmed Elkhalfi and
Sorin Vlase, Flow of Newtonian
Incompressible Fluids in Square Media:
Isogeometric vs. Standard Finite Element
Method, Mathematics, 2023, Vol. 11, No 17,
3702, pp.1-14,
https://doi.org/10.3390/math11173702.
[12] Vladislav Kozák, Jiří Vala, Modelling of
crack formation and growth using FEM for
selected structural materials at static loading,
WSEAS Transactions on Applied and
Theoretical Mechanics, Vol. 18, 2023,
WSEAS TRANSACTIONS on SYSTEMS
DOI: 10.37394/23202.2024.23.21
I. G. Burova
E-ISSN: 2224-2678
194
Volume 23, 2024
pp.243-254,
https://doi.org/10.37394/232011.2023.18.23.
[13] Jinghua Chen, Shaoqiang Wang, Hao Shi, Bin
Chen, Junbang Wang, Chen Zheng and Kai
Zhu, Radiation and temperature dominate the
spatiotemporal variability in resilience of
subtropical evergreen forests in China, Front.
For. Glob. Change, 17 April 2023, Sec. Forest
Disturbance, Vol. 6, 2023, pp.1-12,
https://doi.org/10.3389/ffgc.2023.1166481.
[14] L. Stucchi, D. Fugazza, A. Sharifi, G.
Traversa, G. Diolaiuti, D. Bocchiola, An
algorithm to generate 2D bathymetry of an
Alpine river for habitat suitability assessment,
Science of the Total Environment, Vol. 918,
2024, 170703, pp.1-14.
[15] J.M.Ortega, W.G.Poole, An introduction to
numerical methods for differential equations,
London, 1981.
[16] S. G. Mikhlin, Variational-grid
approximation. Notes of scientific seminars of
the LOMI Academy of Sciences of the USSR.
48, 1974, pp. 32–188. (In Russian)
[17] I.G. Burova, On left integro-differential
splines and Cauchy problem, International
Journal of Mathematical Models and Methods
in Applied Sciences, Vol.9, 2015, pp. 683-690.
Contribution of Individual Authors to the
Creation of a Scientific Article (Ghostwriting
Policy)
I.G. Burova was responsible for ideas, conducting a
research and investigation process, specifically
performing the experiments.
Sources of Funding for Research Presented in a
Scientific Article or Scientific Article Itself
The authors are gratefully indebted to St. Petersburg
University for their financial support in the
preparation of this paper (ID 118437477), as well as
to a resource center for providing the package
Maple.
Conflict of Interest
The authors have no conflicts of interest to declare.
Creative Commons Attribution License 4.0
(Attribution 4.0 International, CC BY 4.0)
This article is published under the terms of the
Creative Commons Attribution License 4.0
https://creativecommons.org/licenses/by/4.0/deed.en
_US
WSEAS TRANSACTIONS on SYSTEMS
DOI: 10.37394/23202.2024.23.21
I. G. Burova
E-ISSN: 2224-2678
195
Volume 23, 2024