Login  Register

Re: polynomial fitting with LeastSquareProblem / CurveFitting.cpp

Posted by Bojan Nikolic on Apr 07, 2009; 8:09am
URL: http://quantlib.414.s1.nabble.com/polynomial-fitting-with-LeastSquareProblem-CurveFitting-cpp-tp7378p7379.html


Hi Piers,

The problem is that you are mixing the example which was originally
called CurvedFitting.cpp with the current implementation of
least-square-fitting in QuantLib which is significantly different. For
example, LeastSquareProblem is not a template class and this is why
you get the first error that you do get. There are a few other
adjustments that need to be made:

* No need to define operator<<

* Need to supply a constraint for the LeastSquareProblem

* targetValueAndGradient not targetValueAndfirstDerivative

* size_t or QuantLib::Size not int

I've put the modified example that does compile and seems to work at
the following address:

http://www.bnikolic.co.uk/blog/ql-fitting-curves.html

Best,
Bojan

--
Bojan Nikolic          ||          http://www.bnikolic.co.uk

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users