Research Article | Open Access
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
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.
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  in the lowest order case and generalized to higher degree by Lancaster and Salkauskas . 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.  and Naceur et al.  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) . TLS approach is tightly related to the maximum likelihood principal component analysis method introduced in chemometrics by Schuermans et al. . 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  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 .
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 , 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.
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.
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.
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.
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).
- 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.
- R. Franke, “Approximation of scattered data for meteorological applications,” International Journal for Numerical Methods, vol. 94, pp. 107–120, 1990.
- H. Hagen, Topics in Surface Modeling, SIAM, Philadelphia, Pa, USA, 1992.
- 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.
- P. Lancaster and K. Salkauskas, Curve and Surface Fitting: An Introduction, Academic Press, London, UK, 1986.
- 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.
- D. Shepard, “A two-dimensional interpolation function for irregularly spaced points,” in Proceedings of the 23rd ACM National Conference, pp. 517–524, 1968.
- P. Lancaster and K. Salkauskas, “Surfaces generated by moving least squares methods,” Mathematics of Computation, vol. 37, pp. 141–158, 1981.
- 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.
- 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.
- 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.
- 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.
- G. Golub, “Some modified matrix eigenvalue problems,” SIAM Review, vol. 15, no. 2, pp. 318–344, 1973.
- 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.
- 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.
- 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.
- D. H. McLain, “Drawing contours from arbitrary data point,” Computer Journal, vol. 17, no. 4, pp. 318–324, 1974.
- 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.
- S. van Huffel and J. Vandewalle, The Total Least Squares Problem: Computational Aspects and Analysis, SIAM, Philadelphia, Pa, USA, 1991.
- 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.
- 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.
- 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.
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.