#### Abstract

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 IMLS method, 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.

#### 1. Introduction

Methods of approximation or interpolation of measured data are considered by many authors [1–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.

#### 2. 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 is a primary function of th-degree and 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–17].

#### 3. IMLS Method

##### 3.1. TLS Method

The TLS problem [18, 19] is a generalization of the OLS method when an errors-in-variables (EIV) model is considered. Here , are measurement errors and , are true values. The TLS estimate of , that is, the solution of (3), corresponding to , is proven to provide a consistent estimator of , when the elements of and are zero mean i.i.d.

Let be a singular value decomposition of , let , be the singular values of , and define the partitionings

A TLS solution exists if and only if is nonsingular. In addition, it is unique if and only if . In this case, TLS solution is given by

##### 3.2. 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 and are matrices related to and 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.

##### 3.3. 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 1. * Add the known random error to the measured data for getting tested data .

*Step 2. * is set to .

*Step 3. * Fit the tested data using IMLS for getting fitting value .

*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 6. * Repeat Steps 3–5 until reaches the minimum value.

*Step 7. *Record corresponding to the minimum value of .

*Step 8. * Repeat Steps 1–7 times.

*Step 9. *Average the recorded values of and take it as the final value for in IMLS method.

#### 4. 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 , , 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 above-mentioned 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 is the reciprocal of the curvature radius of the base vertex and 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.

*Example 3. *Consider the function
defined on the region . Take a random uniformly distributed set of points in . The measured points are generated in the same way as Examples 1 and 2 and fitted by MLS and IMLS methods, respectively. 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. 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 or ).

**(a) Example 1**

**(b) Example 2**

**(c) Example 3**

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 , , , , , and varies from 0.49 to 0.51, the time required for determining is about 1.5 hours.

#### 5. 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.

#### Acknowledgments

The authors are grateful for the financial support from the National High Technology Research and Development Program (863 Program) of China (Grant no. 2012AA041304), the National Key Basic Research and Development Program (973 program) of China (Grant no. 2011CB706702), and Specialized Research Fund for the Doctoral Program of Higher Education of China (Grant no. 20110061110022).