2

I am having a hard time understanding how to use DerivativeStructure in Apache Commons Math.

I have a Logit function for which I would like to get the first order derivative. Then I would like to get the value of that derivative on multiple distinct values.

Logit logit = new Logit(0.1, 10.0);
DerivativeStructure ds =   // How to instanctiate?
DerivativeStructure dsRes = logit.value(ds);
// How to use dsRes to get the value of the derivative function applied on
// several values?

In addition, if there is any document describing how to use that DerivativeStructure, I am highly interested!

Thanks for your help.

Jean Logeart
  • 52,687
  • 11
  • 83
  • 118
  • How about referring to JavaDocs: http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/analysis/differentiation/DerivativeStructure.html – Rahul Bobhate May 27 '13 at 11:25
  • Well I read it but it appears it is not descriptive enough for me to use it. I tried a few things to test it but it has remained unsuccessful. I believe my use case is easy enough not to have to read a full paper to come to a solution. I would have liked the Javadoc to give just a few examples so that a new comer can use it confidently after reading them. – Jean Logeart May 27 '13 at 11:30
  • 1
    Have you read the [user guide on Numerical Analysis, section 4.7](http://commons.apache.org/proper/commons-math/userguide/analysis.html)? As far as I can tell it gives a decent introduction to differentiation using `DerivativeStructure`. – Anders Gustafsson May 27 '13 at 12:28
  • @AndersGustafsson Great! I did not see it myself... Add this as an answer so I can accept it :) – Jean Logeart May 27 '13 at 16:00
  • Glad it helped, please see my answer below. – Anders Gustafsson May 27 '13 at 16:18

1 Answers1

3

In the Apache Commons Math User Guide, the section on Numerical analysis Differentiation, there is a reasonable introduction on how to apply the DerivativeStructure.

Anders Gustafsson
  • 15,837
  • 8
  • 56
  • 114