Compute the Jacobian matrix for a function f(y) with m components in n independent variables.

Namespace: Imsl.Math
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.0.0

Syntax

C#
[SerializableAttribute]
public class NumericalDerivatives
Visual Basic (Declaration)
<SerializableAttribute> _
Public Class NumericalDerivatives
Visual C++
[SerializableAttribute]
public ref class NumericalDerivatives

Remarks

NumericalDerivatives uses divided finite differences to compute the Jacobian. This class is designed for use in numerical methods for solving nonlinear problems where a Jacobian is evaluated repeatedly at neighboring arguments. For example, this occurs in a Gauss-Newton method for solving non-linear least squares problems or a non-linear optimization method.

NumericalDerivatives is suited for applications where the Jacobian is a dense matrix. All cases m \lt n, m = n, or m \gt n are allowed. Both one-sided and central divided differences can be used.

The design allows for computation of derivatives in a variety of contexts. Note that a gradient should be considered as the special case with m = 1, n \ge 1. A derivative of a single function of one variable is the case m = 1, n = 1. Any non-linear solving routine that optionally requests a Jacobian or gradient can use NumericalDerivatives. This should be considered if there are special properties or scaling issues associated with f(y). Use the method SetDifferencingMethods to specify different differencing options for numerical differentiation. These can be combined with some analytic subexpressions or other known relationships.

The divided differences are computed using values of the independent variables at the initial point y_e = y, and differenced points y_e = y + del \times e_j. Here the e_j, j = 1, ..., n, are the unit coordinate vectors. The value for each difference del depends on the variable j, the differencing method, and the scaling for that variable. This difference is computed internally. See SetPercentageFactor for computational details. The evaluation of f(y_e) is normally done by the user-provided method NumericalDerivatives.IFunction.F, using the values y_e. The index j and values y_e are arguments to NumericalDerivatives.IFunction.F.

The computational kernel of EvaluateJ performs the following steps: evaluate the equations at the point y using NumericalDerivatives.IFunction.F.compute the Jacobian.compute the difference at y_e.

By default, EvaluateJ uses NumericalDerivatives.IFunction.F in step 3. The user may choose to override the EvaluateF method to extend the capability of the class beyond the default.

There are six examples provided which illustrate various ways to use NumericalDerivatives. A discussion of the expected errors for these difference methods is found in A First Course in Numerical Analysis, Anthony Ralston, McGraw-Hill, NY, (1965).

Inheritance Hierarchy

System..::.Object
Imsl.Math..::.NumericalDerivatives

See Also