Login  Register

Re: MINPACK error with PiecewiseConstantParameter class

Posted by Luigi Ballabio on Sep 11, 2009; 2:38pm
URL: http://quantlib.414.s1.nabble.com/MINPACK-error-with-PiecewiseConstantParameter-class-tp7946p7949.html

On Thu, 2009-09-03 at 05:19 -0700, javit wrote:
> It took me sometime to figure out what is wrong. It turns out that after the
> optimized parameters are called, I call the model class once more to get the
> node values.

I'm not sure I follow. Is this in your code or in the library? What
class or function does the calls? It sounds strange that the solver is
called again after the parameters have been optimized...

> Therefore, in Solver1d.hpp, I believe that one should check the accuracy of
> the starting points (is f(x_1) - f(x_2) close to zero and is f(x_1) close to
> zero?) before checking the signs of the f(x_1) and f(x_2).
>
> The current checks are:
>
> Is f(x_1) = 0 ?
> Is f(x_2) = 0 ?
>
> Rather than this, it should be:
> Is Abs( f(x_1) ) < accuracy?
> Is Abs( f(x_2) ) < accuracy?

The problem here is that the interface of Solver1D is not clearly
defined. Depending on the particular solver, the required accuracy might
be on the y axis (i.e., give me an x for which abs(f(x)) < accuracy) or
on the x axis (give me an x for which abs(x-x0) < accuracy, where x0 is
the real root.) The above only works with y accuracy.

Luigi


--

Every solution breeds new problems.
-- unknown



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users