in reply to polynomial fit module

The best way to find the minimum of a polynomial (or, in general, any differentiable function) is to take the derivative and solve it for 0. This actually gives the extreme; you would then evaluate the 2d derivative at that point to see whether its a maximum or minimum. You could try Math::Symbolic::Derivative or Math::Derivative to get the derivatives. If you're only concerned with a range of x values, and f'(x) doesn't cross zero in this range, the minimum will be at one of the endpoints of the interval.

Since you're always dealing with polynomials, it should be simple to write a sub to give you the derivative, i.e., you can probably do without Math::Symbolic::Derivative or Math::Derivative.

emc

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

Albert Einstein

Replies are listed 'Best First'.
Re^2: polynomial fit module
by duc (Beadle) on Aug 22, 2006 at 15:57 UTC
    Thanks to you. It is a really nice reminder about how to find a minimum but unfortunately, I cannot use it directly. I guess I haven't defined my problem well enough. I have a list of x and y, not the equation it represents. So I have to find it. Math::polynomial does the job for me and it also gives me the extremum. Which is exactly what I need. So, I need to resolve the equation y = polynomial to get the x that matchs the y found. But, then againg, I think I have asked too soon, I did finally found a module who looks like it can solve my problem (with that dear google friend of mine) : Math::GSL::Polynomial.