[Haskell-cafe] numeric minimization in Haskell

ajb at spamcop.net ajb at spamcop.net
Wed Feb 28 19:42:05 EST 2007


G'day all.

Quoting David Roundy <droundy at darcs.net>:

> Conjugate gradients shouldn't require more than about five lines of code
> (which I don't have time to write at the moment), apart from array code for
> the vectors you wish to minimize.

I apologise for the quality of the code, but here's an implementation
of the Marquardt-Levenberg algorithm (which is actually a smooth
interpolation between the conjugate gradient and Newton-Raphson methods),
which I had to do a year or so ago:

    http://andrew.bromage.org/darcs/misc/Marquardt.hs

It even includes code to compute standard errors on the parameters.

Cheers,
Andrew Bromage


More information about the Haskell-Cafe mailing list