[jira] Created: (MATH-372) Curve fitting appears unreliable

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (MATH-372) Curve fitting appears unreliable

JIRA jira@apache.org
Curve fitting appears unreliable
--------------------------------

                 Key: MATH-372
                 URL: https://issues.apache.org/jira/browse/MATH-372
             Project: Commons Math
          Issue Type: Bug
    Affects Versions: 2.1
         Environment: Win7 x64, Netbeans, JDK 1.6.0.18
            Reporter: Matt Price


I've been trying to find a good curve fitting library for Java for the last couple of weeks.  I came across Apache Commons Math and was really excited because I like all things Apache.  The curve fitting API looks good and is fairly easy to use.  However, it doesn't seem to be as accurate as it should/could be.

I've produced some code and data that shows that the initial parameter guesses affect the results too much.  Guess low and the curve ends up low, guess high and the curve ends up high.  I wish I had a stronger statistics/math background to make more sense of this.  I've tried playing with the optimizer's options (costRelativeToTolerance, initialStepBoundFactor, maxEvaluations, maxIterations, orthTolerance and parRelativeTolerance) but nothing seems to improve the end result.

I've attached the spreadsheet and Java code.  FYI, in the spreadsheet you'll see an entry in the chart for DataFitX.  It is a COM library used in my company's current software that needs to be replaced.

Any help on this would be greatly appreciated.  If you need more info, let me know and I'll supply it as quickly as I can.

Thanks,
Matt

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (MATH-372) Curve fitting appears unreliable

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/MATH-372?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Price updated MATH-372:
----------------------------

     Original Estimate: 8h  (was: 48h)
    Remaining Estimate: 8h  (was: 48h)

> Curve fitting appears unreliable
> --------------------------------
>
>                 Key: MATH-372
>                 URL: https://issues.apache.org/jira/browse/MATH-372
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Win7 x64, Netbeans, JDK 1.6.0.18
>            Reporter: Matt Price
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> I've been trying to find a good curve fitting library for Java for the last couple of weeks.  I came across Apache Commons Math and was really excited because I like all things Apache.  The curve fitting API looks good and is fairly easy to use.  However, it doesn't seem to be as accurate as it should/could be.
> I've produced some code and data that shows that the initial parameter guesses affect the results too much.  Guess low and the curve ends up low, guess high and the curve ends up high.  I wish I had a stronger statistics/math background to make more sense of this.  I've tried playing with the optimizer's options (costRelativeToTolerance, initialStepBoundFactor, maxEvaluations, maxIterations, orthTolerance and parRelativeTolerance) but nothing seems to improve the end result.
> I've attached the spreadsheet and Java code.  FYI, in the spreadsheet you'll see an entry in the chart for DataFitX.  It is a COM library used in my company's current software that needs to be replaced.
> Any help on this would be greatly appreciated.  If you need more info, let me know and I'll supply it as quickly as I can.
> Thanks,
> Matt

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (MATH-372) Curve fitting appears unreliable

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/MATH-372?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Price updated MATH-372:
----------------------------

    Description:
I've been trying to find a good curve fitting library for Java for the last couple of weeks.  I came across Apache Commons Math and was really excited because I like all things Apache.  The curve fitting API looks good and is fairly easy to use, however, it doesn't seem to be as accurate as it should/could be.

I've produced some code and data that shows that the initial parameter guesses affect the results too much.  Guess low and the curve ends up low, guess high and the curve ends up high.  I wish I had a stronger statistics/math background to make more sense of this.  I've tried playing with the optimizer's options (costRelativeToTolerance, initialStepBoundFactor, maxEvaluations, maxIterations, orthTolerance and parRelativeTolerance) but nothing seems to improve the end result.

I've attached the spreadsheet and Java code.  FYI, in the spreadsheet you'll see an entry in the chart for DataFitX.  It is a COM library used in my company's current software that needs to be replaced.

Any help on this would be greatly appreciated.  If you need more info, let me know and I'll supply it as quickly as I can.

Thanks,
Matt

  was:
I've been trying to find a good curve fitting library for Java for the last couple of weeks.  I came across Apache Commons Math and was really excited because I like all things Apache.  The curve fitting API looks good and is fairly easy to use.  However, it doesn't seem to be as accurate as it should/could be.

I've produced some code and data that shows that the initial parameter guesses affect the results too much.  Guess low and the curve ends up low, guess high and the curve ends up high.  I wish I had a stronger statistics/math background to make more sense of this.  I've tried playing with the optimizer's options (costRelativeToTolerance, initialStepBoundFactor, maxEvaluations, maxIterations, orthTolerance and parRelativeTolerance) but nothing seems to improve the end result.

I've attached the spreadsheet and Java code.  FYI, in the spreadsheet you'll see an entry in the chart for DataFitX.  It is a COM library used in my company's current software that needs to be replaced.

Any help on this would be greatly appreciated.  If you need more info, let me know and I'll supply it as quickly as I can.

Thanks,
Matt


> Curve fitting appears unreliable
> --------------------------------
>
>                 Key: MATH-372
>                 URL: https://issues.apache.org/jira/browse/MATH-372
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Win7 x64, Netbeans, JDK 1.6.0.18
>            Reporter: Matt Price
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> I've been trying to find a good curve fitting library for Java for the last couple of weeks.  I came across Apache Commons Math and was really excited because I like all things Apache.  The curve fitting API looks good and is fairly easy to use, however, it doesn't seem to be as accurate as it should/could be.
> I've produced some code and data that shows that the initial parameter guesses affect the results too much.  Guess low and the curve ends up low, guess high and the curve ends up high.  I wish I had a stronger statistics/math background to make more sense of this.  I've tried playing with the optimizer's options (costRelativeToTolerance, initialStepBoundFactor, maxEvaluations, maxIterations, orthTolerance and parRelativeTolerance) but nothing seems to improve the end result.
> I've attached the spreadsheet and Java code.  FYI, in the spreadsheet you'll see an entry in the chart for DataFitX.  It is a COM library used in my company's current software that needs to be replaced.
> Any help on this would be greatly appreciated.  If you need more info, let me know and I'll supply it as quickly as I can.
> Thanks,
> Matt

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (MATH-372) Curve fitting appears unreliable

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/MATH-372?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Price updated MATH-372:
----------------------------

    Attachment: CurveFitterDebug.java
                CurveFitting.ods

Java code for curve fitting and a spreadsheet with results.

> Curve fitting appears unreliable
> --------------------------------
>
>                 Key: MATH-372
>                 URL: https://issues.apache.org/jira/browse/MATH-372
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Win7 x64, Netbeans, JDK 1.6.0.18
>            Reporter: Matt Price
>         Attachments: CurveFitterDebug.java, CurveFitting.ods
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> I've been trying to find a good curve fitting library for Java for the last couple of weeks.  I came across Apache Commons Math and was really excited because I like all things Apache.  The curve fitting API looks good and is fairly easy to use, however, it doesn't seem to be as accurate as it should/could be.
> I've produced some code and data that shows that the initial parameter guesses affect the results too much.  Guess low and the curve ends up low, guess high and the curve ends up high.  I wish I had a stronger statistics/math background to make more sense of this.  I've tried playing with the optimizer's options (costRelativeToTolerance, initialStepBoundFactor, maxEvaluations, maxIterations, orthTolerance and parRelativeTolerance) but nothing seems to improve the end result.
> I've attached the spreadsheet and Java code.  FYI, in the spreadsheet you'll see an entry in the chart for DataFitX.  It is a COM library used in my company's current software that needs to be replaced.
> Any help on this would be greatly appreciated.  If you need more info, let me know and I'll supply it as quickly as I can.
> Thanks,
> Matt

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (MATH-372) Curve fitting appears unreliable

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/MATH-372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12873323#action_12873323 ]

Luc Maisonobe commented on MATH-372:
------------------------------------

It seems to me there is a sign error in the computation of the second component of the gradient in your code.
Once the sign of this component is changed, the algorithm seems to converge even from the first low guess.
Could you confirm this fixes your problem ?

> Curve fitting appears unreliable
> --------------------------------
>
>                 Key: MATH-372
>                 URL: https://issues.apache.org/jira/browse/MATH-372
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Win7 x64, Netbeans, JDK 1.6.0.18
>            Reporter: Matt Price
>         Attachments: CurveFitterDebug.java, CurveFitting.ods
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> I've been trying to find a good curve fitting library for Java for the last couple of weeks.  I came across Apache Commons Math and was really excited because I like all things Apache.  The curve fitting API looks good and is fairly easy to use, however, it doesn't seem to be as accurate as it should/could be.
> I've produced some code and data that shows that the initial parameter guesses affect the results too much.  Guess low and the curve ends up low, guess high and the curve ends up high.  I wish I had a stronger statistics/math background to make more sense of this.  I've tried playing with the optimizer's options (costRelativeToTolerance, initialStepBoundFactor, maxEvaluations, maxIterations, orthTolerance and parRelativeTolerance) but nothing seems to improve the end result.
> I've attached the spreadsheet and Java code.  FYI, in the spreadsheet you'll see an entry in the chart for DataFitX.  It is a COM library used in my company's current software that needs to be replaced.
> Any help on this would be greatly appreciated.  If you need more info, let me know and I'll supply it as quickly as I can.
> Thanks,
> Matt

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (MATH-372) Curve fitting appears unreliable

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/MATH-372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12873728#action_12873728 ]

Matt Price commented on MATH-372:
---------------------------------

Luc,

Thanks for your help.  I changed the sign for this example it converges beautifully.  I'll test this fix with a few more scenarios that gave me trouble.

I really appreciate the help.  This issue was going to be a show stopper and I couldn't be happier that the problem is on my end.  Makes me want to contribute some money to Apache :)

Thanks,
Matt

> Curve fitting appears unreliable
> --------------------------------
>
>                 Key: MATH-372
>                 URL: https://issues.apache.org/jira/browse/MATH-372
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Win7 x64, Netbeans, JDK 1.6.0.18
>            Reporter: Matt Price
>         Attachments: CurveFitterDebug.java, CurveFitting.ods
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> I've been trying to find a good curve fitting library for Java for the last couple of weeks.  I came across Apache Commons Math and was really excited because I like all things Apache.  The curve fitting API looks good and is fairly easy to use, however, it doesn't seem to be as accurate as it should/could be.
> I've produced some code and data that shows that the initial parameter guesses affect the results too much.  Guess low and the curve ends up low, guess high and the curve ends up high.  I wish I had a stronger statistics/math background to make more sense of this.  I've tried playing with the optimizer's options (costRelativeToTolerance, initialStepBoundFactor, maxEvaluations, maxIterations, orthTolerance and parRelativeTolerance) but nothing seems to improve the end result.
> I've attached the spreadsheet and Java code.  FYI, in the spreadsheet you'll see an entry in the chart for DataFitX.  It is a COM library used in my company's current software that needs to be replaced.
> Any help on this would be greatly appreciated.  If you need more info, let me know and I'll supply it as quickly as I can.
> Thanks,
> Matt

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (MATH-372) Curve fitting appears unreliable

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/MATH-372?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Luc Maisonobe resolved MATH-372.
--------------------------------

    Resolution: Invalid

OK, so I'm going to set the "invalid" resolution tag for this issue. If you find another problem, please open a new issue so we can track it down.


> Curve fitting appears unreliable
> --------------------------------
>
>                 Key: MATH-372
>                 URL: https://issues.apache.org/jira/browse/MATH-372
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Win7 x64, Netbeans, JDK 1.6.0.18
>            Reporter: Matt Price
>         Attachments: CurveFitterDebug.java, CurveFitting.ods
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> I've been trying to find a good curve fitting library for Java for the last couple of weeks.  I came across Apache Commons Math and was really excited because I like all things Apache.  The curve fitting API looks good and is fairly easy to use, however, it doesn't seem to be as accurate as it should/could be.
> I've produced some code and data that shows that the initial parameter guesses affect the results too much.  Guess low and the curve ends up low, guess high and the curve ends up high.  I wish I had a stronger statistics/math background to make more sense of this.  I've tried playing with the optimizer's options (costRelativeToTolerance, initialStepBoundFactor, maxEvaluations, maxIterations, orthTolerance and parRelativeTolerance) but nothing seems to improve the end result.
> I've attached the spreadsheet and Java code.  FYI, in the spreadsheet you'll see an entry in the chart for DataFitX.  It is a COM library used in my company's current software that needs to be replaced.
> Any help on this would be greatly appreciated.  If you need more info, let me know and I'll supply it as quickly as I can.
> Thanks,
> Matt

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (MATH-372) Curve fitting appears unreliable

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/MATH-372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12877530#action_12877530 ]

Matt Price commented on MATH-372:
---------------------------------

A quick update...

I've successfully gotten linear and non-linear regression working via Apache Commons Math for linear, point-to-point, log-log, 4PL and 5PL regression models.  The troubles I had were due to errors in complex derivatives.  My aim is to replace software that is currently using a commercial product (DataFitX).  From what I can tell, Apache Commons Math is faster and more accurate that DataFitX.  Good job Apache :)

P.S. Wolfram Alpha is a great website for solving your regression model's derivatives (www.wolframalpha.com)

> Curve fitting appears unreliable
> --------------------------------
>
>                 Key: MATH-372
>                 URL: https://issues.apache.org/jira/browse/MATH-372
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Win7 x64, Netbeans, JDK 1.6.0.18
>            Reporter: Matt Price
>         Attachments: CurveFitterDebug.java, CurveFitting.ods
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> I've been trying to find a good curve fitting library for Java for the last couple of weeks.  I came across Apache Commons Math and was really excited because I like all things Apache.  The curve fitting API looks good and is fairly easy to use, however, it doesn't seem to be as accurate as it should/could be.
> I've produced some code and data that shows that the initial parameter guesses affect the results too much.  Guess low and the curve ends up low, guess high and the curve ends up high.  I wish I had a stronger statistics/math background to make more sense of this.  I've tried playing with the optimizer's options (costRelativeToTolerance, initialStepBoundFactor, maxEvaluations, maxIterations, orthTolerance and parRelativeTolerance) but nothing seems to improve the end result.
> I've attached the spreadsheet and Java code.  FYI, in the spreadsheet you'll see an entry in the chart for DataFitX.  It is a COM library used in my company's current software that needs to be replaced.
> Any help on this would be greatly appreciated.  If you need more info, let me know and I'll supply it as quickly as I can.
> Thanks,
> Matt

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (MATH-372) Curve fitting appears unreliable

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/MATH-372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12877530#action_12877530 ]

Matt Price edited comment on MATH-372 at 6/10/10 2:56 PM:
----------------------------------------------------------

A quick update...

I've successfully gotten linear and non-linear regression working via Apache Commons Math for linear, point-to-point, log-log, 4PL and 5PL regression models.  The troubles I had were due to errors in complex derivatives.  My aim is to replace software that is currently using a commercial product (DataFitX).  From what I can tell, Apache Commons Math is faster and more accurate than DataFitX.  Good job Apache :)

P.S. Wolfram Alpha is a great website for solving your regression model's derivatives (www.wolframalpha.com)

      was (Author: mprice):
    A quick update...

I've successfully gotten linear and non-linear regression working via Apache Commons Math for linear, point-to-point, log-log, 4PL and 5PL regression models.  The troubles I had were due to errors in complex derivatives.  My aim is to replace software that is currently using a commercial product (DataFitX).  From what I can tell, Apache Commons Math is faster and more accurate that DataFitX.  Good job Apache :)

P.S. Wolfram Alpha is a great website for solving your regression model's derivatives (www.wolframalpha.com)
 

> Curve fitting appears unreliable
> --------------------------------
>
>                 Key: MATH-372
>                 URL: https://issues.apache.org/jira/browse/MATH-372
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Win7 x64, Netbeans, JDK 1.6.0.18
>            Reporter: Matt Price
>         Attachments: CurveFitterDebug.java, CurveFitting.ods
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> I've been trying to find a good curve fitting library for Java for the last couple of weeks.  I came across Apache Commons Math and was really excited because I like all things Apache.  The curve fitting API looks good and is fairly easy to use, however, it doesn't seem to be as accurate as it should/could be.
> I've produced some code and data that shows that the initial parameter guesses affect the results too much.  Guess low and the curve ends up low, guess high and the curve ends up high.  I wish I had a stronger statistics/math background to make more sense of this.  I've tried playing with the optimizer's options (costRelativeToTolerance, initialStepBoundFactor, maxEvaluations, maxIterations, orthTolerance and parRelativeTolerance) but nothing seems to improve the end result.
> I've attached the spreadsheet and Java code.  FYI, in the spreadsheet you'll see an entry in the chart for DataFitX.  It is a COM library used in my company's current software that needs to be replaced.
> Any help on this would be greatly appreciated.  If you need more info, let me know and I'll supply it as quickly as I can.
> Thanks,
> Matt

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.