[Scipy-tickets] [SciPy] #1510: Add Hessian method to Scipy

SciPy Trac scipy-tickets@scipy....
Fri Sep 9 06:12:42 CDT 2011

#1510: Add Hessian method to Scipy
 Reporter:  deil                                               |       Owner:  somebody   
     Type:  enhancement                                        |      Status:  new        
 Priority:  normal                                             |   Milestone:  Unscheduled
Component:  scipy.optimize                                     |     Version:  0.9.0      
 Keywords:  Hesse, Hessian, numerical differentiationrical di  |  

Comment(by deil):

 I think very few authors would make the claim that they can guarantee that
 their software is bug-free. :-)
 It's better to have a method that in certain complicated cases gives
 inaccurate results, compared to having no method to compute derivatives at
 all in scipy.

 You mentioned that automatic differentiation is more robust and stable
 than numeric differentiation.

 Another criterion to consider for inclusion is code size:
 numdifftools has about 1300 lines (plus 300 for the nice algopy wrapper)
 and algopy has about 5000 (including comment and whitespace):

        7 __init__.py
     1308 core.py
       84 info.py
      299 nd_algopy.py

       68 __init__.py
      111 base_type.py
      306 exact_interpolation.py
      229 globalfuncs.py
      212 utils.py
     1003 tracer/tracer.py
     1708 utpm/algorithms.py
     1938 utpm/utpm.py

 And an even more important consideration is ease of use.
 It seems to me that numdifftools is dead simple to use (because Jacobian
 etc. can be used as if they were functions), and algopy requires a few
 minutes to understand how to use it (because one has to instantiate a
 complicate-sounding object first and then extract the derivative),
 although as you show in your nd_algopy wrapper it is possible to use
 algopy through the same simple interface as numdifftools.

 Actually, why not include both methods in scipy and the user can just
 choose (similar how scipy.optimize has many different optimizers)?
 result = scipy.diff.gradient(function, method="numeric")
 result = scipy.diff.gradient(function, method="automatic")

 One point I'd like to make is that I am just a Scipy user that was
 complaining that there was no method to compute derivatives in scipy.
 Maybe one of the scipy developers can comment if derivative methods as
 available now in the BSD-licenced numdifftools and/or algopy packages
 would be welcome in Scipy!?
 And if so, where in Scipy would it fit best and do they require any API
 changes or further tests before inclusion?


Ticket URL: <http://projects.scipy.org/scipy/ticket/1510#comment:2>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.

More information about the Scipy-tickets mailing list