Home | Trees | Index | Help |
---|
Package numdifftools :: Module core :: Class Common_diff_par |
|
object
--+
|
Common_diff_par
Derivative
,
Jacobian
Object holding common variables and methods for the numdifftools Input arguments =============== fun = function to differentiate. **kwds ------ derOrder : Integer from 1 to 4 defining derivative order. (Default 1) metOrder : Integer from 1 to 4 defining order of basic method used. (For 'central' methods, it must be from the set [2,4]. (Default 2) method : Method of estimation. Valid options are: 'central', 'forward' or 'backwards'. (Default 'central') numTerms : Number of Romberg terms used in the extrapolation. Must be an integer from 0 to 3. (Default 2) Note: 0 disables the Romberg step completely. stepFix : If not None, it will define the maximum excursion from x0 that is used and prevent the adaptive logic from working. This will be considerably faster, but not necessarily as accurate as allowing the adaptive logic to run. (Default: None) stepMax : Maximum allowed excursion from x0 as a multiple of x0. (Default 100) stepRatio: Ratio used between sequential steps in the estimation of the derivative (Default 2) vectorized : True - if your function is vectorized. False - loop over the successive function calls (default). Uses a semi-adaptive scheme to provide the best estimate of the derivative by its automatic choice of a differencing interval. It uses finite difference approximations of various orders, coupled with a generalized (multiple term) Romberg extrapolation. This also yields the error estimate provided. See the document DERIVEST.pdf for more explanation of the algorithms behind the parameters. Note on metOrder: higher order methods will generally be more accurate, but may also suffer more from numerical problems. First order methods would usually not be recommended. Note on method: Central difference methods are usually the most accurate, but sometimes one can only allow evaluation in forward or backward direction.
Method Summary | |
---|---|
__init__(self,
fun,
**kwds)
| |
check the parameters for acceptability | |
Return matrix for fda derivation. | |
Return backward differences... | |
Return central differences... | |
Return forward differences... | |
Return Romberg extrapolated derivatives and error estimates based on the initial derivative estimates... | |
Set derivative parameters: stepsize, differention rule and romberg extrapolation | |
Set the steps to use in derivation. | |
Generate finite differencing rule in advance. | |
Set _fdiff fun according to method | |
Member variables used... | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
Inherited from type | |
T.__new__(S, ...) -> a new object with type S, a subtype of T |
Method Details |
---|
_check_params(self)check the parameters for acceptability |
_fdamat(self, parity, nterms)Return matrix for fda derivation. Parameters ---------- parity : scalar, integer 0 (one sided, all terms included but zeroth order) 1 (only odd terms included) 2 (only even terms included) nterms : scalar, integer number of terms Member variables used --------------------- stepRatio |
_fdiff_b(self, f_x0i, x0i, h)Return backward differences Member variables used --------------------- fun vectorized |
_fdiff_c(self, f_x0i, x0i, h)Return central differences Member variables used derOrder fun vectorized |
_fdiff_f(self, f_x0i, x0i, h)Return forward differences Member variables used fun vectorized |
_rombextrap(self, der_init)Return Romberg extrapolated derivatives and error estimates based on the initial derivative estimates Parameter --------- der_init - initial derivative estimates Returns ------- der_romb - derivative estimates returned errest - error estimates Member variables used --------------------- stepRatio - Ratio decrease in step rombexpon - higher order terms to cancel using the romberg step |
_set_all_der_par(self)Set derivative parameters: stepsize, differention rule and romberg extrapolation |
_set_delta(self)Set the steps to use in derivation. Member variables used: derOrder metOrder method numTerms stepFix stepMax |
_set_fdarule(self)Generate finite differencing rule in advance. The rule is for a nominal unit step size, and will be scaled later to reflect the local step size. Member methods used ------------------- _fdamat Member variables used --------------------- derOrder metOrder method |
_set_fdiff(self)Set _fdiff fun according to method |
_set_rombexpon(self)Member variables used metOrder method numTerms |
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.0 on Sat Nov 22 02:00:54 2008 | http://epydoc.sf.net |