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(y_1 ,y_2 ) = a\exp (by_1 ) + cy_1 y_2^2$$
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 \( y_2 \), potentially avoiding
cancellation errors. Also, \( cy_2^2 \) appears as an additive term when
computing the partial with respect to \(y_1\). 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.