public class NumericalDerivativesEx3 extends Object
Approximates the gradient with a combination of numerical derivatives and analytic derivatives.
This example uses the same data as inNumericalDerivativesEx2
. An
examination of the function
f(y1,y2)=aexp(by1)+cy1y22
shows that the first term on the right-hand side does not depend on
the second variable, and therefore can be left out of the evaluation of the
first partial of f with respect to y2, potentially avoiding
cancellation errors. Also, cy22 appears as an additive term when
computing the partial with respect to y1. This examples shows how different
terms in a derivative can be used explicitly and then added to approximated
terms.
The input values of array
options
allow NumericalDerivatives
to use these
facts and obtain greater accuracy using fewer evaluations of
the exponential function.Constructor and Description |
---|
NumericalDerivativesEx3() |
public static void main(String[] args)
Copyright © 2020 Rogue Wave Software. All rights reserved.