statsmodels.tools.numdiff.approx_fprime_cs(x, f, epsilon=None, args=(), kwargs={})
[source]
Calculate gradient or Jacobian with complex step derivative approximation
Parameters: |
|
---|---|
Returns: |
partials – array of partial derivatives, Gradient or Jacobian |
Return type: |
ndarray |
The complex-step derivative has truncation error O(epsilon**2), so truncation error can be eliminated by choosing epsilon to be very small. The complex-step derivative avoids the problem of round-off error with small epsilon because there is no subtraction.
© 2009–2012 Statsmodels Developers
© 2006–2008 Scipy Developers
© 2006 Jonathan E. Taylor
Licensed under the 3-clause BSD License.
http://www.statsmodels.org/stable/generated/statsmodels.tools.numdiff.approx_fprime_cs.html