非线性最小二乘页PPT文档
- 格式:ppt
- 大小:230.00 KB
- 文档页数:10
非线性最小二乘法编辑词条分享•新知社新浪微博腾讯微博人人网QQ空间网易微博开心001天涯飞信空间MSN移动说客非线性最小二乘法非线性最小二乘法是以误差的平方和最小为准则来估计非线性静态模型参数的一种参数估计方法。
编辑摘要目录1 简介2 推导3 配图4 相关连接非线性最小二乘法 - 简介以误差的平方和最小为准则来估计非线性静态模型参数的一种参数估计方法。
设非线性系统的模型为y=f(x,θ) 式中y是系统的输出,x是输入,θ是参数(它们可以是向量)。
这里的非线性是指对参数θ的非线性模型,不包括输入输出变量随时间的变化关系。
在估计参数时模型的形式f是已知的,经过N次实验取得数据(x1,y1),(x2,y1), ,(xn,yn)。
估计参数的准则(或称目标函数)选为模型的误差平方和非线性最小二乘法就是求使Q达到极小的参数估计值孌。
推导非线性最小二乘法 - 推导以误差的平方和最小为准则来估计非线性静态模型参数的一种参数估计方法。
设非线性系统的模型为y=f(x,θ)式中y是系统的输出,x是输入,θ是参数(它们可以是向量)。
这里的非线性是指对参数θ的非线性模型,不包括输入输出变量随时间的变化关系。
在估计参数时模型的形式f是已知的,经过N次实验取得数据(x1,y1),(x2,y1), ,(x n,y n)。
估计参数的准则(或称目标函数)选为模型的误差平方和非线性最小二乘法就是求使Q达到极小的参数估计值孌。
由于f的非线性,所以不能象线性最小二乘法那样用求多元函数极值的办法来得到参数估计值,而需要采用复杂的优化算法来求解。
常用的算法有两类,一类是搜索算法,另一类是迭代算法。
搜索算法的思路是:按一定的规则选择若干组参数值,分别计算它们的目标函数值并比较大小;选出使目标函数值最小的参数值,同时舍弃其他的参数值;然后按规则补充新的参数值,再与原来留下的参数值进行比较,选出使目标函数达到最小的参数值。
如此继续进行,直到选不出更好的参数值为止。
非线性曲线拟合的最小二乘法及其应用非线性曲线拟合的最小二乘法是一种特殊的最小二乘拟合,源于非
线性回归,通常用来拟合复杂的曲线数据。
该方法包括数据解算和参
数拟合两个部分,在参数拟合部分,使用最小二乘法拟合获得最优的
参数,从而完成非线性曲线的拟合。
非线性曲线拟合的最小二乘法被广泛用于数学计算、信号处理、机器
学习以及物理、化学等多个领域的理论计算和实验研究。
1. 数学计算:可用非线性曲线拟合的最小二乘法进行二次函数拟合、
多项式拟合以及高次函数拟合,用于求解常见数学、物理问题中的数
值解及物理参数估算,并进行复杂程序的拟合和分析。
2. 信号处理:可用非线性最小二乘拟合方法对由采样信号产生的数据
进行拟合,从而获得目标函数的近似曲线,从而改善原信号的质量。
3. 机器学习:也可以用非线性曲线拟合的最小二乘法进行模型的训练,常用于拟合复杂的经验曲线或归纳出经验模型参数,从而用于分析、
定制解决复杂问题。
4. 物理、化学:可用该方法拟合物理、化学实验观测数据,获得各种
物理、化学实验内容的量化数据,绘制出准确的实验曲线,或分析出
物质间的关系及变化规律。
Levenberg-Marquardt Method(麦夸尔特法)Levenberg-Marquardt is a popular alternative to the Gauss-Newton method of finding the minimum of afunction that is a sum of squares of nonlinear functions,Let the Jacobian of be denoted , then the Levenberg-Marquardt method searches in thedirection given by the solution to the equationswhere are nonnegative scalars and is the identity matrix. The method has the nice property that, forsome scalar related to , the vector is the solution of the constrained subproblem of minimizingsubject to (Gill et al. 1981, p. 136).The method is used by the command FindMinimum[f, x, x0] when given the Method -> Levenberg Marquardt option.SEE A LSO:Minimum, OptimizationREFERENCES:Bates, D. M. and Watts, D. G. N onlinear Regr ession and Its Applications. New York: Wiley, 1988.Gill, P. R.; Murray, W.; and Wright, M. H. "The Levenberg-Marquardt Method." §4.7.3 in Practical Optim ization. London: Academic Press, pp. 136-137, 1981.Levenberg, K. "A Method for the Solution of Certain Problems in Least Squares." Quart. Appl. Math.2, 164-168, 1944. Marquardt, D. "An Algor ithm for Least-Squares Estimation of Nonlinear Parameters." SIAM J. Appl. Math.11, 431-441, 1963.Levenberg–Marquardt algorithmFrom Wikipedia, the free encyclopediaJump to: navigation, searchIn mathematics and computing, the Levenberg–Marquardt algorithm (LMA)[1] provides a numerical solution to the problem of minimizing a function, generally nonlinear, over a space of parameters of the function. These minimization problems arise especially in least squares curve fitting and nonlinear programming.The LMA interpolates between the Gauss–Newton algorithm (GNA) and the method of gradient descent. The LMA is more robust than the GNA, which means that in many cases it finds a solution even if it starts very far off the final minimum. For well-behaved functions and reasonable starting parameters, the LMA tends to be a bit slower than the GNA. LMA can also be viewed as Gauss–Newton using a trust region approach.The LMA is a very popular curve-fitting algorithm used in many software applications for solving generic curve-fitting problems. However, the LMA finds only a local minimum, not a global minimum.Contents[hide]∙ 1 Caveat Emptor∙ 2 The problem∙ 3 The solutiono 3.1 Choice of damping parameter∙ 4 Example∙ 5 Notes∙ 6 See also∙7 References∙8 External linkso8.1 Descriptionso8.2 Implementations[edit] Caveat EmptorOne important limitation that is very often over-looked is that it only optimises for residual errors in the dependant variable (y). It thereby implicitly assumes that any errors in the independent variable are zero or at least ratio of the two is so small as to be negligible. This is not a defect, it is intentional, but it must be taken into account when deciding whether to use this technique to do a fit. While this may be suitable in context of a controlled experiment there are many situations where this assumption cannot be made. In such situations either non-least squares methods should be used or the least-squares fit should be done in proportion to the relative errors in the two variables, not simply the vertical "y" error. Failing to recognise this can lead to a fit which is significantly incorrect and fundamentally wrong. It will usually underestimate the slope. This may or may not be obvious to the eye.MicroSoft Excel's chart offers a trend fit that has this limitation that is undocumented. Users often fall into this trap assuming the fit is correctly calculated for all situations. OpenOffice spreadsheet copied this feature and presents the same problem.[edit] The problemThe primary application of the Levenberg–Marquardt algorithm is in the least squares curve fitting problem: given a set of m empirical datum pairs of independent and dependent variables, (x i, y i), optimize the parameters β of the model curve f(x,β) so that the sum of the squares of the deviationsbecomes minimal.[edit] The solutionLike other numeric minimization algorithms, the Levenberg–Marquardt algorithm is an iterative procedure. To start a minimization, the user has to provide an initial guess for the parameter vector, β. In many cases, an uninformed standard guess like βT=(1,1,...,1) will work fine;in other cases, the algorithm converges only if the initial guess is already somewhat close to the final solution.In each iteration step, the parameter vector, β, is replaced by a new estimate, β + δ. To determine δ, the functions are approximated by their linearizationswhereis the gradient(row-vector in this case) of f with respect to β.At its minimum, the sum of squares, S(β), the gradient of S with respect to δwill be zero. The above first-order approximation of gives.Or in vector notation,.Taking the derivative with respect to δand setting theresult to zero gives:where is the Jacobian matrix whose i th row equals J i,and where and are vectors with i th componentand y i, respectively. This is a set of linear equations which can be solved for δ.Levenberg's contribution is to replace this equation by a "damped version",where I is the identity matrix, giving as the increment, δ, to the estimated parameter vector, β.The (non-negative) damping factor, λ, isadjusted at each iteration. If reduction of S is rapid, a smaller value can be used, bringing the algorithm closer to the Gauss–Newton algorithm, whereas if an iteration gives insufficientreduction in the residual, λ can be increased, giving a step closer to the gradient descentdirection. Note that the gradient of S withrespect to β equals .Therefore, for large values of λ, the step will be taken approximately in the direction of the gradient. If either the length of the calculated step, δ, or the reduction of sum of squares from the latest parameter vector, β + δ, fall below predefined limits, iteration stops and the last parameter vector, β, is considered to be the solution.Levenberg's algorithm has the disadvantage that if the value of damping factor, λ, is large, inverting J T J + λI is not used at all. Marquardt provided the insight that we can scale eachcomponent of the gradient according to thecurvature so that there is larger movement along the directions where the gradient is smaller. This avoids slow convergence in the direction of small gradient. Therefore, Marquardt replaced theidentity matrix, I, with the diagonal matrixconsisting of the diagonal elements of J T J,resulting in the Levenberg–Marquardt algorithm:.A similar damping factor appears in Tikhonov regularization, which is used to solve linear ill-posed problems, as well as in ridge regression, an estimation technique in statistics.[edit] Choice of damping parameterVarious more-or-less heuristic arguments have been put forward for the best choice for the damping parameter λ. Theoretical arguments exist showing why some of these choices guaranteed local convergence of the algorithm; however these choices can make the global convergence of the algorithm suffer from the undesirable properties of steepest-descent, in particular very slow convergence close to the optimum.The absolute values of any choice depends on how well-scaled the initial problem is. Marquardt recommended starting with a value λ0 and a factor ν>1. Initially setting λ=λ0and computing the residual sum of squares S(β) after one step from the starting point with the damping factor of λ=λ0 and secondly withλ0/ν. If both of these are worse than the initial point then the damping is increased by successive multiplication by νuntil a better point is found with a new damping factor of λ0νk for some k.If use of the damping factor λ/ν results in a reduction in squared residual then this is taken as the new value of λ (and the new optimum location is taken as that obtained with this damping factor) and the process continues; if using λ/ν resulted in a worse residual, but using λresulted in a better residual then λ is left unchanged and the new optimum is taken as the value obtained with λas damping factor.[edit] ExamplePoor FitBetter FitBest FitIn this example we try to fit the function y = a cos(bX) + b sin(aX) using theLevenberg–Marquardt algorithm implemented in GNU Octave as the leasqr function. The 3 graphs Fig 1,2,3 show progressively better fitting for the parameters a=100, b=102 used in the initial curve. Only when the parameters in Fig 3 are chosen closest to the original, are thecurves fitting exactly. This equation is an example of very sensitive initial conditions for the Levenberg–Marquardt algorithm. One reason for this sensitivity is the existenceof multiple minima —the function cos(βx)has minima at parameter value and[edit] Notes1.^ The algorithm was first published byKenneth Levenberg, while working at theFrankford Army Arsenal. It was rediscoveredby Donald Marquardt who worked as astatistician at DuPont and independently byGirard, Wynn and Morrison.[edit] See also∙Trust region[edit] References∙Kenneth Levenberg(1944). "A Method for the Solution of Certain Non-Linear Problems in Least Squares". The Quarterly of Applied Mathematics2: 164–168.∙ A. Girard (1958). Rev. Opt37: 225, 397. ∙ C.G. Wynne (1959). "Lens Designing by Electronic Digital Computer: I". Proc.Phys. Soc. London73 (5): 777.doi:10.1088/0370-1328/73/5/310.∙Jorje J. Moré and Daniel C. Sorensen (1983)."Computing a Trust-Region Step". SIAM J.Sci. Stat. Comput. (4): 553–572.∙ D.D. Morrison (1960). Jet Propulsion Laboratory Seminar proceedings.∙Donald Marquardt (1963). "An Algorithm for Least-Squares Estimation of NonlinearParameters". SIAM Journal on AppliedMathematics11 (2): 431–441.doi:10.1137/0111030.∙Philip E. Gill and Walter Murray (1978)."Algorithms for the solution of thenonlinear least-squares problem". SIAMJournal on Numerical Analysis15 (5):977–992. doi:10.1137/0715063.∙Nocedal, Jorge; Wright, Stephen J. (2006).Numerical Optimization, 2nd Edition.Springer. ISBN0-387-30303-0.[edit] External links[edit] Descriptions∙Detailed description of the algorithm can be found in Numerical Recipes in C, Chapter15.5: Nonlinear models∙ C. T. Kelley, Iterative Methods for Optimization, SIAM Frontiers in AppliedMathematics, no 18, 1999, ISBN0-89871-433-8. Online copy∙History of the algorithm in SIAM news∙ A tutorial by Ananth Ranganathan∙Methods for Non-Linear Least Squares Problems by K. Madsen, H.B. Nielsen, O.Tingleff is a tutorial discussingnon-linear least-squares in general andthe Levenberg-Marquardt method inparticular∙T. Strutz: Data Fitting and Uncertainty (A practical introduction to weighted least squares and beyond). Vieweg+Teubner, ISBN 978-3-8348-1022-9.[edit] Implementations∙Levenberg-Marquardt is a built-in algorithm with Mathematica∙Levenberg-Marquardt is a built-in algorithm with Matlab∙The oldest implementation still in use is lmdif, from MINPACK, in Fortran, in thepublic domain. See also:o lmfit, a translation of lmdif into C/C++ with an easy-to-use wrapper for curvefitting, public domain.o The GNU Scientific Library library hasa C interface to MINPACK.o C/C++ Minpack includes theLevenberg–Marquardt algorithm.o Several high-level languages andmathematical packages have wrappers forthe MINPACK routines, among them:▪Python library scipy, modulescipy.optimize.leastsq,▪IDL, add-on MPFIT.▪R (programming language) has theminpack.lm package.∙levmar is an implementation in C/C++ with support for constraints, distributed under the GNU General Public License.o levmar includes a MEX file interface for MATLABo Perl (PDL), python and Haskellinterfaces to levmar are available: seePDL::Fit::Levmar, PyLevmar andHackageDB levmar.∙sparseLM is a C implementation aimed at minimizing functions with large,arbitrarily sparse Jacobians. Includes a MATLAB MEX interface.∙ALGLIB has implementations of improved LMA in C# / C++ / Delphi / Visual Basic.Improved algorithm takes less time toconverge and can use either Jacobian orexact Hessian.∙NMath has an implementation for the .NET Framework.∙gnuplot uses its own implementation .∙Java programming language implementations:1) Javanumerics, 2) LMA-package (a small,user friendly and well documentedimplementation with examples and support),3) Apache Commons Math∙OOoConv implements the L-M algorithm as an Calc spreadsheet.∙SAS, there are multiple ways to access SAS's implementation of the Levenberg-Marquardt algorithm: it can be accessed via NLPLMCall in PROC IML and it can also be accessed through the LSQ statement in PROC NLP, and the METHOD=MARQUARDT option in PROC NLIN.。
非线性最小二乘问题非线性最小二乘问题是一种解决实际应用中非线性系统求解最优化问题的有效方法,是研究遥感、机器人导航、机床控制、智能控制等领域的研究的基础。
非线性最小二乘问题具有普遍性,在很多学科和领域中都有广泛的应用。
一般来说,非线性最小二乘问题是一种优化问题,它涉及到求解满足条件的参数及其对应的函数最小值,其函数由基本函数和残差函数两部分组成。
基本函数又称作目标函数,是根据实际问题解题的依据;残差函数又称作约束函数,是根据实际约束条件而确定的。
因此,非线性最小二乘问题的求解步骤有以下几个:(1)确定基本函数和残差函数;(2)确定求解的参数及其范围;(3)对对应的函数最小值,采用梯度下降法等优化方法求解;(4)判断最小值是否满足目标要求,以达到最优化的效果。
其中,梯度下降法是一种常用的优化方法,它可以帮助求解非线性最小二乘问题,梯度下降法的基本思想是,在每次迭代中,根据目标函数对变量的梯度信息,找到该函数局部最小值,通过迭代搜索不断改进求解结果,使得每次迭代都能获得更优的结果。
另外,针对不同问题,还可以采用其他有效的优化方法,如模拟退火算法、粒子群算法等,它们都可以有效解决非线性最小二乘问题。
模拟退火算法是一种迭代算法,它可以有效地控制步长,从而有效改善求解结果;粒子群算法是一种仿生算法,它可以通过考虑各个粒子之间的信息交互,自动学习出有效的优化参数,从而有效求解非线性最小二乘问题。
总之,非线性最小二乘问题是一种常见的优化问题,其解题的基本步骤是确定基本函数和残差函数,然后采用梯度下降法、模拟退火算法、粒子群算法等有效的优化方法,从而求解满足约束条件的非线性最小二乘问题最优解。
研究非线性最小二乘问题,有利于更好地解决遥感、机器人导航、机床控制等工程实际应用中的问题,从而实现更高效的控制和决策。