Research Article | Open Access

Volume 2013 |Article ID 159694 | https://doi.org/10.1155/2013/159694

Lei Zhang, Tianqi Gu, Ji Zhao, Shijun Ji, Ming Hu, Xiangbo Li, "An Improved Moving Least Squares Method for Curve and Surface Fitting", Mathematical Problems in Engineering, vol. 2013, Article ID 159694, 6 pages, 2013. https://doi.org/10.1155/2013/159694

# An Improved Moving Least Squares Method for Curve and Surface Fitting

Revised01 Nov 2013
Accepted01 Nov 2013
Published20 Nov 2013

#### 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 [16]. 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 [1517].

#### 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 35 until reaches the minimum value.

Step 7. Record corresponding to the minimum value of .

Step 8. Repeat Steps 17    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.

 MLS IMLS 0.000001 0.001 1.320980 0.175673 0.49310417 0.00001 0.001 1.323738 0.172833 0.49310563 0.0001 0.001 1.316369 0.172238 0.49312047 0.001 0.001 1.320659 0.177658 0.49313993 0.001 0.0001 1.317848 0.157265 0.49312350 0.001 0.00001 1.318954 0.146745 0.49311082 0.001 0.000001 1.315052 0.145775 0.49309692

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.

 MLS IMLS 0.000001 0.001 0.050892 0.041262 0.50019680 0.00001 0.001 0.049675 0.042708 0.50018100 0.0001 0.001 0.049482 0.040264 0.50015440 0.001 0.001 0.049789 0.042724 0.50010860 0.001 0.0001 0.041764 0.013429 0.50013496 0.001 0.00001 0.041718 0.013170 0.50013892 0.001 0.000001 0.041467 0.013092 0.50014048

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.

 MLS IMLS 0.000001 0.001 2.525123 0.592784 0.500148 0.00001 0.001 2.531644 0.594762 0.500158 0.0001 0.001 2.525867 0.593739 0.500166 0.001 0.001 2.578295 0.754762 0.500534 0.001 0.0001 2.555807 0.664834 0.500680 0.001 0.00001 2.553651 0.667688 0.500666 0.001 0.000001 2.558244 0.666255 0.500656

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 ).

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).

#### References

1. R. Franke and K. Šalkauskas, “Localization of multivariate interpolation and smoothing methods,” Journal of Computational and Applied Mathematics, vol. 73, no. 1-2, pp. 79–94, 1996. View at: Google Scholar
2. R. Franke, “Approximation of scattered data for meteorological applications,” International Journal for Numerical Methods, vol. 94, pp. 107–120, 1990. View at: Google Scholar
3. H. Hagen, Topics in Surface Modeling, SIAM, Philadelphia, Pa, USA, 1992.
4. R. Franke, H. Hagen, and G. M. Nielson, “Least squares surface approximation to scattered data using multiquadratic functions,” Advances in Computational Mathematics, vol. 2, no. 1, pp. 81–99, 1994. View at: Publisher Site | Google Scholar
5. P. Lancaster and K. Salkauskas, Curve and Surface Fitting: An Introduction, Academic Press, London, UK, 1986.
6. X. Jiang, X. Zhang, and P. J. Scott, “Template matching of freeform surfaces based on orthogonal distance fitting for precision metrology,” Measurement Science and Technology, vol. 21, no. 4, Article ID 045101, 2010. View at: Publisher Site | Google Scholar
7. D. Shepard, “A two-dimensional interpolation function for irregularly spaced points,” in Proceedings of the 23rd ACM National Conference, pp. 517–524, 1968. View at: Google Scholar
8. P. Lancaster and K. Salkauskas, “Surfaces generated by moving least squares methods,” Mathematics of Computation, vol. 37, pp. 141–158, 1981. View at: Google Scholar
9. I. Svalina, K. Sabo, and G. Šimunović, “Machined surface quality prediction models based on moving least squares and moving least absolute deviations methods,” International Journal of Advanced Manufacturing Technology, vol. 57, no. 9–12, pp. 1099–1106, 2011. View at: Publisher Site | Google Scholar
10. G. Ingarao and R. Di Lorenzo, “A contribution on the optimization strategies based on moving least squares approximation for sheet metal forming design,” International Journal of Advanced Manufacturing Technology, vol. 64, pp. 411–425, 2013. View at: Publisher Site | Google Scholar
11. P. Breitkopf, H. Naceur, A. Rassineux, and P. Villon, “Moving least squares response surface approximation: formulation and metal forming applications,” Computers and Structures, vol. 83, no. 17-18, pp. 1411–1428, 2005. View at: Publisher Site | Google Scholar
12. H. Naceur, S. Ben-Elechi, J. L. Batoz, and C. Knopf-Lenoir, “Response surface methodology for the rapid design of aluminum sheet metal forming parameters,” Materials and Design, vol. 29, no. 4, pp. 781–790, 2008. View at: Publisher Site | Google Scholar
13. G. Golub, “Some modified matrix eigenvalue problems,” SIAM Review, vol. 15, no. 2, pp. 318–344, 1973. View at: Publisher Site | Google Scholar
14. M. Schuermans, I. Markovsky, P. D. Wentzell, and S. van Huffel, “On the equivalence between total least squares and maximum likelihood PCA,” Analytica Chimica Acta, vol. 544, no. 1-2, pp. 254–267, 2005. View at: Publisher Site | Google Scholar
15. W. S. Cleveland, S. J. Devlin, and E. Grosse, “Regression by local fitting: methods, properties, and computational algorithms,” Journal of Econometrics, vol. 37, no. 1, pp. 87–114, 1988. View at: Google Scholar
16. R. Farwig, “Multivariate interpolation of scattered data by moving least squares methods,” in Algorithms for Approximation, J. C. Mason and M. G. Cox, Eds., pp. 193–211, Clarendon Press, Oxford, UK, 1987. View at: Google Scholar
17. D. H. McLain, “Drawing contours from arbitrary data point,” Computer Journal, vol. 17, no. 4, pp. 318–324, 1974. View at: Google Scholar
18. G. H. Golub and V. Loan, “An analysis of the total least squares problem,” SIAM Journal on Numerical Analysis, vol. 17, no. 6, pp. 883–893, 1980. View at: Publisher Site | Google Scholar
19. S. van Huffel and J. Vandewalle, The Total Least Squares Problem: Computational Aspects and Analysis, SIAM, Philadelphia, Pa, USA, 1991.
20. U. Häussler-Combe and C. Korn, “An adaptive approach with the Element-Free-Galerkin method,” Computer Methods in Applied Mechanics and Engineering, vol. 162, no. 1-4, pp. 203–222, 1998. View at: Google Scholar
21. Z. Yingjie and G. Liling, “Improved moving least squares algorithm for directed projecting onto point clouds,” Measurement, vol. 44, no. 10, pp. 2008–2019, 2011. View at: Publisher Site | Google Scholar
22. G. Q. Li, Z. P. Meng, and F. S. Ma, “Calculation of stratum surface principal curvature based on a moving least square method,” Journal of China University of Mining and Technology, vol. 18, pp. 0059–0063, 2008. View at: Google Scholar

Copyright © 2013 Lei Zhang et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### More related articles

Order printed copiesOrder
Views4766
Citations

#### Related articles

Article of the Year Award: Outstanding research contributions of 2020, as selected by our Chief Editors. Read the winning articles.