I've managed to construct a Minerr implementation to complement my earlier Genfit implementation (see attached file). Their MSEs are about the same.
On 4/5/2010 6:32:21 PM, Tom_Gutman wrote:
>The formulation of the
>objective function for your
>genfit and minerr
>implementations are very
>different. It's not even
>clear that they represent the
>same function.
My Minerr objective function is defined explicitly. I'm not sure what the Genfit objective function is.
>
>The actual problem, noticeable
>if you trace back the error,
>is that you are attempting to
>pass a vector argument to f,
>and f is not designed to
>support that. So the whole
>construct fails.
My new Minerr objective function avoids this problem.
>
>I stand by my assertion that
>genfit is unnecessary and
>useless, and that minerr, when
>properly set up, is generally
>superior.
If my new Minerr implementation is proper, then Genfit is indeed unnecessary. Although Minerr seems only marginally superior wrt the MSE, it is much more convenient to set up (those vector derivatives needed by Genfit were tedious to derive).
>
>Also, in section 3, you are
>inverting function F (a slow
>process, as F is defined as an
>integral, and its integrand
>also involves an integral).
>Minerr is not appropriate
>here, the appropriate solve
>block is find. Usually the
>actual values will be the
>same, but find will report an
>error if a (reasonably) exact
>solution cannot be found,
>while minerr will happily
>return more or less random
>results, if that is all it can
>find.
Here, my choice of Minerr rather than Find was deliberate, considering: (a) the gamma-gamma probability distribution function is well-behaved, so I thought that Minerr will always return a (reasonably) approximate solution and so never report an error (as Find might); and (b) the ragged quality generally associated with the histograms means that exact solutions are unnecessary.