Calculate gradient or Jacobian with complex step derivative approximation
Parameters : | x : array
f : function
epsilon : float, optional
args : tuple
kwargs : dict
|
---|---|
Returns : | partials : ndarray
|
Notes
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.