An Improved Moving Least Squares Method for Curve and Surface Fitting

The moving least squares (MLS) method has been developed for the fitting of measured data contaminated with random error. The local approximants of MLS method only take the error of dependent variable into account, whereas the independent variable of measured data always contains random error. Considering the errors of all variables, this paper presents an improved moving least squares (IMLS) method to generate curve and surface for the measured data. In IMLSmethod, total least squares (TLS) with a parameter λ based on singular value decomposition is introduced to the local approximants. A procedure is developed to determine the parameter λ. Numerical examples for curve and surface fitting are given to prove the performance of IMLS method.


Introduction
Methods of approximation or interpolation of measured data are considered by many authors [1][2][3][4][5][6].The moving least squares (MLS) as an approximation method has been introduced by Shepard [7] in the lowest order case and generalized to higher degree by Lancaster and Salkauskas [8].The object of those works is to provide an alternative to classic interpolation for approximating a function from its values given at irregularly spaced points by using weighted least squares approximations.This method is to start with a weighted least squares formulation for an arbitrary fixed point and then move this point over the entire parameter domain, where a weighted least squares fit is calculated and evaluated for each measured point individually.The MLS approximation has been largely documented in the literature and used by many scholars for optimization problems and widely used in many types of application in the engineering literatures [9,10].Among them, Breitkopf et al. [11] and Naceur et al. [12] have presented an extended approach of pattern search algorithms with a fixed pattern panned and zoomed in a continuous manner across the design space.
But MLS method determines local approximants in the sense of ordinary least squares (OLS).When errors occur in all of the variables, it makes more sense to determine the local approximants in the sense of total least squares (TLS) [13].TLS approach is tightly related to the maximum likelihood principal component analysis method introduced in chemometrics by Schuermans et al. [14].TLS, as same as OLS, could not well apply to the complicated curve and surface fitting.But compared with OLS method, TLS method considers the errors of all variables.
In this paper, an improved moving least squares (IMLS) method is proposed, in which TLS with a parameter  based on singular value decomposition for considering the varying errors of all variables is introduced to the local approximants of MLS method for determining the local coefficients.In Section 2, a brief description is given for MLS method.IMLS method is presented in detail in Section 3.And curve and surface fitting examples are given in Section 4 for comparing IMLS method with MLS method.Conclusions are drawn in Section 5.

MLS Method
In the following, only the main aspects of MLS method will be emphasized.In the MLS approximation, the trial function can be expressed as where   () = [ 1 (),  2 (), . . .,   ()] is a primary function of th-degree and () = [ 1 (),  2 (), . . .,   ()]  represents the corresponding undetermined matrix of coefficients, in which these coefficients are a function of the coordinates of point .
For the local approximants at , a scattered normal form is defined as where   is the discrete point to be fitted within the influence domain of .And (−  ) is a weight function which defines the influence domain of  and attributes a weight to each discrete point depending on its position relative to .The weight function is positive and its value increases with the decrease of the distance ‖ −   ‖ between  and   .Various ways of choosing such functions can be found in the literature [15][16][17].

IMLS Method
3.1.TLS Method.The TLS problem [18,19] min is a generalization of the OLS method when an errors-invariables (EIV) model is considered.Here Ã, B are measurement errors and  0 ,  0 are true values.The TLS estimate of  0 , that is, the solution of (3), corresponding to , is proven to provide a consistent estimator of  0 , when the elements of Ã and B are zero mean i.i.d.Let be a singular value decomposition of , let  1 ≥ ⋅ ⋅ ⋅ ≥  + , be the singular values of , and define the partitionings A TLS solution exists if and only if  22 is nonsingular.In addition, it is unique if and only if   ̸ =  +1 .In this case, TLS solution is given by

IMLS Method.
In this paper, a close attention is paid to the local approximants of MLS method.Considering the errors of all variables, TLS method with a parameter  set between  and  is introduced to the local approximants of MLS method, forming an improved moving least squares (IMLS) method.
In IMLS method, define   for local approximants at  as where  = diag(, . . ., ) × and  = diag(1−, . . ., 1−) × are matrices related to  and   = diag(( −  1 ), . . ., ( −   )) is a weight matrix with compact support.In this paper, the following weight function given by [20] is used: where the parameter  allows controlling the weight function (here  is fixed to 1/2) and  defines the influence domain of .
In the influence domain at , the coefficients of local approximants are solved by In this paper, the linear approximation of local approximants is considered only.

The Determination of Parameter 𝜆.
As known, it is a difficult task to analyze the fitting error for complicated curve.Unlike the straight line fitting, the data is obtained by measurement device from a real object or mechanical part, and the profile of object has not an explicit analytical expression [21].
The following procedure is carried out in this paper to determine the parameter  in IMLS method.
Step 2.  is set to  0 .
Step 4. According to [22], calculate the fitting error  of the measured value   and fitting value and record the value of .
Step 5. Vary  with an increment of certain step ℎ.
Step 7. Record  corresponding to the minimum value of .
Step 9. Average the recorded values of  and take it as the final value for  in IMLS method.

Numerical Examples and Analysis
In this section, three examples are given to verify the performance of IMLS method.MLS method is also applied in the examples to make a comparison.

Example 1. Consider the function
and choose a uniformly distributed set of points (  ,   ),  = 1, 2, . . ., , determined by (12) and add   and   , which are normally distributed random errors with mean value of zero, to   and   , respectively, forming a set of measured points.
And  in the IMLS method is determined by the abovementioned procedure.MLS and IMLS are both applied to fit the measured points.The fitting performance is characterized by the fitting error of the real value and fitting value where   is the real value and   here is the fitting value for measured data.
The fitting results are summarized in Table 1.The fitting curve for Example 1 using IMLS method is illustrated in Figure 1.

Example 2. Consider the function
where  = 1/1083 is the reciprocal of the curvature radius of the base vertex and  = −1 is the constant of the quadric surface.The measured points are generated in the same way as Example 1 and fitted by MLS and IMLS, respectively.And fitting results are listed in Table 2.The fitting curve for Example 2 using IMLS method is illustrated in Figure 2.     where   is the real value and   here is the fitting value for measured data.And the fitting results are listed in Table 3.The fitting surface for Example 3 using IMLS method is illustrated in Figure 3.
From the above examples, it can be seen that the fitting results of IMLS are always better than those of MLS method.The variations of parameter  with the errors of variables for three examples based on the above procedure are shown in Figure 4.The results of three examples show that parameter  may be the same value when the errors of independent variable and dependent variable are totally different.Moreover, parameter  illustrates a nonstrict symmetry and the valley (peak) value is not necessarily determined at the point lg(  /  ) = 0 (or lg( , /  ) = 0).
The computation for case study is implemented on a personal computer with MATLAB.The extra time is required for determining the parameter  in IMLS.In Example 1, when  = 2,  = 160,  = 0.3/10, ℎ = 0.00001,  = 100, and  varies from 0.49 to 0.51, the time required for determining  is about 1.5 hours.

Conclusions
The advantage of the MLS approximation is to obtain the shape function with higher order continuity and consistency by employing the basis functions with lower order and choosing a suitable weight function with compact support.The local approximants of MLS only consider the error of dependent variable.However, all variables in the measurement are always perturbed.The paper presents a new curve and surface fitting method called improved moving least squares (IMLS) method which considers the errors of all variables.Different from MLS method, TLS with a parameter  based on singular value decomposition is introduced to the local approximants in IMLS method.A procedure is given to determine the parameter .The curve and surface fitting results by IMLS method for the discrete points generated by numerical simulation are compared with those by MLS method on the same condition.IMLS method gives better performance than MLS method for the varying errors of variables, which confirms the validity of the proposed IMLS method in this paper.

Figure 1 :
Figure 1: The fitting curve of IMLS method for Example 1.

Figure
Figure The fitting curve of IMLS method for Example 2.

Figure 4 :
Figure 4: The variation of parameter  with the errors of variables.

Table 1 :
The  0 of two methods for Example 1.

Table 2 :
The  0 of two methods for Example 2.

Table 3 :
The  0 of two methods for Example 3.