[jira] [Created] (MATH-726) Ridders derivative

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

[jira] [Created] (MATH-726) Ridders derivative

Gary D. Gregory (Jira)
Ridders derivative
------------------

                 Key: MATH-726
                 URL: https://issues.apache.org/jira/browse/MATH-726
             Project: Commons Math
          Issue Type: New Feature
            Reporter: Gilles
            Assignee: Gilles
            Priority: Minor
             Fix For: 3.0


Implementation of the numerical first derivative, as described in:
{noformat}
Accurate computation of F'(x) and F'(x) F''(x)
C. J. F. Ridders
Adv. Eng. Software, 1982, Vol 4, No. 2
{noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (MATH-726) Ridders derivative

Gary D. Gregory (Jira)

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

Gilles updated MATH-726:
------------------------

    Attachment: RiddersFirstDerivative.java

Attached proposed implementation. OK to add?

               

> Ridders derivative
> ------------------
>
>                 Key: MATH-726
>                 URL: https://issues.apache.org/jira/browse/MATH-726
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Minor
>              Labels: features
>             Fix For: 3.0
>
>         Attachments: RiddersFirstDerivative.java
>
>
> Implementation of the numerical first derivative, as described in:
> {noformat}
> Accurate computation of F'(x) and F'(x) F''(x)
> C. J. F. Ridders
> Adv. Eng. Software, 1982, Vol 4, No. 2
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (MATH-726) Ridders derivative

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

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

Luc Maisonobe commented on MATH-726:
------------------------------------

If we want to implement derivatives, I would rather set up a top level interface and several implementations, including this one. We could for example import the definitions from Nabla core package ([http://svn.apache.org/viewvc/commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/core/]) and the implementations of Nabla numerical package ([http://svn.apache.org/viewvc/commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/numerical/]). Of course, once imported these packages would be removed from Nabla itself and replaced by a dependency to Math.
               

> Ridders derivative
> ------------------
>
>                 Key: MATH-726
>                 URL: https://issues.apache.org/jira/browse/MATH-726
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Minor
>              Labels: features
>             Fix For: 3.0
>
>         Attachments: RiddersFirstDerivative.java
>
>
> Implementation of the numerical first derivative, as described in:
> {noformat}
> Accurate computation of F'(x) and F'(x) F''(x)
> C. J. F. Ridders
> Adv. Eng. Software, 1982, Vol 4, No. 2
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (MATH-726) Ridders derivative

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

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

Gilles commented on MATH-726:
-----------------------------

The proposed code was modelled against the structure of solvers and optimizers classes (method "derivative" is the counterpart of "solve" and "optimize", respectively).
What you propose seems to depart from this, but I cannot really judge because I don't know anything about "nabla".

It may be the right way in the longer term... However, given the resources devoted to "nabla", I don't think that it is wise to force Commons Math to fit the current design of "nabla". I see well that "nabla" and CM could converge at the time of CM version 4.0. :)
But for v3.x it could be fine to provide the low-level bits (?).

But it can also be that I completely missed your point. If so, could you please post the code that would help me figure out what you propose?

               

> Ridders derivative
> ------------------
>
>                 Key: MATH-726
>                 URL: https://issues.apache.org/jira/browse/MATH-726
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Minor
>              Labels: features
>             Fix For: 3.0
>
>         Attachments: RiddersFirstDerivative.java
>
>
> Implementation of the numerical first derivative, as described in:
> {noformat}
> Accurate computation of F'(x) and F'(x) F''(x)
> C. J. F. Ridders
> Adv. Eng. Software, 1982, Vol 4, No. 2
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (MATH-726) Ridders derivative

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

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

Phil Steitz commented on MATH-726:
----------------------------------

+1 to moving the [nabla] numerics code into [math] and standardizing on the [nabla] API (which will become the [math] API that [nabla] will depend on). If the API is not to everyone's liking, we can change it.  The relevant classes are in o.a.c.nabla.numerical and o.a.c.nabla.core in the [nabla] sandbox svn, per Luc's links above.

Might be best to postpone this until post-3.0, as the package additions could be done in 3.1 without breaks; but I would personally be OK with a lift and load from [nabla] (along with the proposed Ridder's impl) for 3.0 if someone is willing to do the work.
               

> Ridders derivative
> ------------------
>
>                 Key: MATH-726
>                 URL: https://issues.apache.org/jira/browse/MATH-726
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Minor
>              Labels: features
>             Fix For: 3.0
>
>         Attachments: RiddersFirstDerivative.java
>
>
> Implementation of the numerical first derivative, as described in:
> {noformat}
> Accurate computation of F'(x) and F'(x) F''(x)
> C. J. F. Ridders
> Adv. Eng. Software, 1982, Vol 4, No. 2
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (MATH-726) Ridders derivative

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

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

Luc Maisonobe commented on MATH-726:
------------------------------------

I think we can wait to 3.1, as this would be mainly a new package.
               

> Ridders derivative
> ------------------
>
>                 Key: MATH-726
>                 URL: https://issues.apache.org/jira/browse/MATH-726
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Minor
>              Labels: features
>             Fix For: 3.0
>
>         Attachments: RiddersFirstDerivative.java
>
>
> Implementation of the numerical first derivative, as described in:
> {noformat}
> Accurate computation of F'(x) and F'(x) F''(x)
> C. J. F. Ridders
> Adv. Eng. Software, 1982, Vol 4, No. 2
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (MATH-726) Ridders derivative

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

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

Gilles commented on MATH-726:
-----------------------------

We could wait, but I don't understand why we should.
The code is there, and could already be useful as is. Moreover, what you propose regarding the convergence with "nabla" is far from clear to me.
IIUC, "nabla" computes the derivative of a function, _without any additional input_. The Ridders algorithm however is an approximating procedure where you must specify a tolerance, an initial "delta" and a maximum number of function evaluations (just like for the solvers and optimizers algorithms).
For CM design consistency's sake (and ease of use), this algorithm must be introduced in a form that relates to the existing codes in CM, not in a form that one expects will conform to a future requirement from another library.

Later, we can always create adapters that will bridge the CM API to the "nabla" API (e.g. possibly passing the additional parameters needed by the "derivative" method of "RiddersFirstDerivative" in the constructor of the adapter class).

               

> Ridders derivative
> ------------------
>
>                 Key: MATH-726
>                 URL: https://issues.apache.org/jira/browse/MATH-726
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Minor
>              Labels: features
>             Fix For: 3.0
>
>         Attachments: RiddersFirstDerivative.java
>
>
> Implementation of the numerical first derivative, as described in:
> {noformat}
> Accurate computation of F'(x) and F'(x) F''(x)
> C. J. F. Ridders
> Adv. Eng. Software, 1982, Vol 4, No. 2
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (MATH-726) Ridders derivative

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

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

Luc Maisonobe commented on MATH-726:
------------------------------------

OK then, I'll take care of this issue and will import Nabla interfaces in Math, trying to merge the two interfaces.

I don't think thee are so much differences. The additional input like tolerances can be specified in the Ridders constructor, just like absolute and relative accuracy are set up in solvers. We could also merge the various Nabla finite differences schemes into one class and use a constructor parameter to choose the number of points in the finite differences. The max evaluations in the would not be used in finite differences.

Here is what I intend to do:

* replace Nabla UnivariateDifferentiable by Math UnivariateFunction
* adapt Nabla UnivariateDerivative to the change above
* keep Nabla DifferentialPair as is
* adapt UnivariateDifferentiator to have an additional max evaluation parameter, in the Solvers spirit

               

> Ridders derivative
> ------------------
>
>                 Key: MATH-726
>                 URL: https://issues.apache.org/jira/browse/MATH-726
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Minor
>              Labels: features
>             Fix For: 3.0
>
>         Attachments: RiddersFirstDerivative.java
>
>
> Implementation of the numerical first derivative, as described in:
> {noformat}
> Accurate computation of F'(x) and F'(x) F''(x)
> C. J. F. Ridders
> Adv. Eng. Software, 1982, Vol 4, No. 2
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (MATH-726) Ridders derivative

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

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

Gilles commented on MATH-726:
-----------------------------

bq. The additional input like tolerances can be specified in the Ridders constructor, [...]

This sentence makes me think that we don't understand each other: the tolerance currently _is_ passed in the constructor. It is the method that computes the derivative (which takes additional parameters and returns a {{double}} in "RiddersFirstDerivative", while in "nabla" I think that the equivalent method would return a "function" object).

Anyways, this should not be a blocking issue, while at the same time, we should probably not jump too quickly to a conclusion concerning the API (here and there). So probably better to leave this for later.

               

> Ridders derivative
> ------------------
>
>                 Key: MATH-726
>                 URL: https://issues.apache.org/jira/browse/MATH-726
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Minor
>              Labels: features
>             Fix For: 3.0
>
>         Attachments: RiddersFirstDerivative.java
>
>
> Implementation of the numerical first derivative, as described in:
> {noformat}
> Accurate computation of F'(x) and F'(x) F''(x)
> C. J. F. Ridders
> Adv. Eng. Software, 1982, Vol 4, No. 2
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (MATH-726) Ridders derivative

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

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

Luc Maisonobe commented on MATH-726:
------------------------------------

OK, so can we postpone this to 3.1 ?
               

> Ridders derivative
> ------------------
>
>                 Key: MATH-726
>                 URL: https://issues.apache.org/jira/browse/MATH-726
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Minor
>              Labels: features
>             Fix For: 3.0
>
>         Attachments: RiddersFirstDerivative.java
>
>
> Implementation of the numerical first derivative, as described in:
> {noformat}
> Accurate computation of F'(x) and F'(x) F''(x)
> C. J. F. Ridders
> Adv. Eng. Software, 1982, Vol 4, No. 2
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (MATH-726) Ridders derivative

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

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

Gilles updated MATH-726:
------------------------

    Fix Version/s:     (was: 3.0)
                   3.1

Postponed.

               

> Ridders derivative
> ------------------
>
>                 Key: MATH-726
>                 URL: https://issues.apache.org/jira/browse/MATH-726
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Minor
>              Labels: features
>             Fix For: 3.1
>
>         Attachments: RiddersFirstDerivative.java
>
>
> Implementation of the numerical first derivative, as described in:
> {noformat}
> Accurate computation of F'(x) and F'(x) F''(x)
> C. J. F. Ridders
> Adv. Eng. Software, 1982, Vol 4, No. 2
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (MATH-726) Ridders derivative

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

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

Gilles updated MATH-726:
------------------------

    Attachment:     (was: RiddersFirstDerivative.java)
   

> Ridders derivative
> ------------------
>
>                 Key: MATH-726
>                 URL: https://issues.apache.org/jira/browse/MATH-726
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Minor
>              Labels: features
>             Fix For: 3.1
>
>
> Implementation of the numerical first derivative, as described in:
> {noformat}
> Accurate computation of F'(x) and F'(x) F''(x)
> C. J. F. Ridders
> Adv. Eng. Software, 1982, Vol 4, No. 2
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (MATH-726) Ridders derivative

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

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

Gilles resolved MATH-726.
-------------------------

       Resolution: Incomplete
    Fix Version/s:     (was: 3.1)

The provided code was buggy.

Since the proposed API is not satisfying, and this does not seem to be high priority, it's better to revisit this once the basic interfaces have been set up.

               

> Ridders derivative
> ------------------
>
>                 Key: MATH-726
>                 URL: https://issues.apache.org/jira/browse/MATH-726
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Minor
>              Labels: features
>
> Implementation of the numerical first derivative, as described in:
> {noformat}
> Accurate computation of F'(x) and F'(x) F''(x)
> C. J. F. Ridders
> Adv. Eng. Software, 1982, Vol 4, No. 2
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira