naginterfaces.library.roots.sys_deriv_check¶
- naginterfaces.library.roots.sys_deriv_check(mode, x, fvec, fjac, fvecp)[source]¶
sys_deriv_check
checks the user-supplied gradients of a set of nonlinear functions in several variables, for consistency with the functions themselves. The function must be called twice.For full information please refer to the NAG Library document for c05zd
https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/c05/c05zdf.html
- Parameters
- modeint
The value on the first call and the value on the second call of
sys_deriv_check
.- xfloat, array-like, shape
The components of a point , at which the consistency check is to be made. (See Accuracy.)
- fvecfloat, array-like, shape
If , must contain the value of the functions evaluated at . If , is not referenced.
- fjacfloat, array-like, shape
If , must contain the value of at the point , for , for . If , is not referenced.
- fvecpfloat, array-like, shape
If , must contain the value of the functions evaluated at (as output by a preceding call to
sys_deriv_check
with ). If , is not referenced.
- Returns
- xpfloat, ndarray, shape
If , is set to a point neighbouring . If , is undefined.
- errfloat, ndarray, shape
If , contains measures of correctness of the respective gradients. If , is undefined. If there is no loss of significance (see Accuracy), if is the th user-supplied gradient , for is correct, whilst if is the th gradient is incorrect. For values of between and the categorisation is less certain. In general, a value of indicates that the th gradient is probably correct.
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: or .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- Notes
sys_deriv_check
is based on the MINPACK routine CHKDER (see Moré et al. (1980)). It checks the th gradient for consistency with the th function by computing a forward-difference approximation along a suitably chosen direction and comparing this approximation with the user-supplied gradient along the same direction. The principal characteristic ofsys_deriv_check
is its invariance under changes in scale of the variables or functions.
- References
Moré, J J, Garbow, B S and Hillstrom, K E, 1980, User guide for MINPACK-1, Technical Report ANL-80-74, Argonne National Laboratory