Re: Trying hard to find ' Findfit ' of Mathematics in C++
- To: mathgroup at smc.vnet.net
- Subject: [mg84887] Re: Trying hard to find ' Findfit ' of Mathematics in C++
- From: nano bagonghi <nano.bagonghiCUT at CUTgmail.com>
- Date: Fri, 18 Jan 2008 05:44:45 -0500 (EST)
- References: <fmmkv3$f57$1@smc.vnet.net>
Mayneord wrote: > Well, I knew how to work with ' Findfit ' of Mathematica but i would > like to know how to do the same in C++. Also I came to know that > there is no direct function in C++ similar to 'Findfit' .. Please is > there somebody who can suggest me how to approach this problem in C++ > or is there already a third party source code available ? It is quite obvious that there cannot be such a function directly in C++ (or in any other of the main programming languages): it is a too hi-level function and can be implemented in hundreds of ways. Mathematica's FindFit has a lot of options (for example, different norms can be used in the process of error minimization), maybe you have a more restricted problem in mind. Anyway, the basic algorithm used by FindFit is a least squares fitting. You can found some information here http://mathworld.wolfram.com/LeastSquaresFitting.html or in other thousands of web pages (and of course in any book about numerical analysis). If you search with google, you'll find surely a lot of c++ code to perform least squares fitting, however, in order to use it properly and obtain meaningful results, I suggest that you must at least understand how it works. bye, g.