I am trying to find a root of an equation using Newton-Raphson provided by SciPy (scipy.optimize.newton).
At the moment I don't have the fprime
values that the documentation advises to use, and as far as I am aware this means that the Secant method is being used to find the roots.
Since the Newton-Raphson method has faster convergence than the Secant method, my gut thinks that maybe I should numerically approximate fprime
and provide it so that Newton's method is used.
Which one would generally lead to faster convergence / faster actual computing of my roots?
- Just using
scipy.optimize.newton
without providingfprime
(i.e. the Secant Method, or - Using numerical differentiation to compute
fprime
(e.g. with numpy.diff) and providing it toscipy.optimize.newton
so that the Newton-Raphson method is used.