MPFit: changing the cost function [message #58595] |
Wed, 06 February 2008 21:22  |
thomas.launey
Messages: 1 Registered: February 2008
|
Junior Member |
|
|
Hello,
I am using Craig Markwardt's MPFit with great enjoyement but I would
like to change the way the model error is calculated. MPfit minimizes
the Chi^2 but for what I want to do, I would prefer minimizing "the
largest relative error" rather than the "mean relative error".
I haven't found any hint in the documentation about "user-defined cost
function". Shall I modify MPfit itself to add this option or did I
miss something?
Thanks,
Thomas
T. Launey
RIKEN Brain Science Institute
|
|
|
Re: MPFit: changing the cost function [message #58637 is a reply to message #58595] |
Mon, 11 February 2008 05:42  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
thomas.launey@ncm.brain.riken.jp writes:
> Hello,
>
> I am using Craig Markwardt's MPFit with great enjoyement but I would
> like to change the way the model error is calculated. MPfit minimizes
> the Chi^2 but for what I want to do, I would prefer minimizing "the
> largest relative error" rather than the "mean relative error".
> I haven't found any hint in the documentation about "user-defined cost
> function". Shall I modify MPfit itself to add this option or did I
> miss something?
> Thanks,
> Thomas
>
> T. Launey
> RIKEN Brain Science Institute
Hello, I'm afraid it's going to be harder than you suspect. The cost
function is built into the technique, namely it is *assumed* that the
cost function is the sum of the squared residuals, and this feeds
directly into the basic factorization approach taken by the code.
I suggest that you will probably want a generic optimizer. One option
is my TNMIN() code, which will max/minimize any arbitrary cost
function.
Good luck!
Craig
|
|
|