commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luc Maisonobe (JIRA)" <>
Subject [jira] [Commented] (MATH-1143) Helper methods to FiniteDifferencesDifferentiator
Date Thu, 30 Apr 2015 11:17:06 GMT


Luc Maisonobe commented on MATH-1143:

If you have function f(x1, x2, x3) and know both the value and the derivatives, you can directly
build the DerivativeStructure as follows:

  int nbParams = 3; // index 0 will be for x1, index 1 for x2, index 2 for x3
  int order         = 1; // we will use only value and first order derivative
  return new DerivativeStructure(nbParams, order, f, dfdx1, dfdx2, dfdx3);

As this constructor as a variable number of arguments, this example can be generalized
to other numbers of parameters.

The order in which the derivatives should be provided is difficult to set up in the general
when both nbParams and order are greater than 1, but it is straightforward in the two limit
cases (nbParams = 1, order > 1) or (nbParams > 1, order = 1). In both cases, you just
the derivatives in the "natural" order, which is in increasing order when you have one parameter
and high order derivatives, and in parameters order when you have only first order derivatives
for all parameters.

> Helper methods to FiniteDifferencesDifferentiator
> -------------------------------------------------
>                 Key: MATH-1143
>                 URL:
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Alexander Nozik
>            Priority: Trivial
> A DerivativeStructure and UnivariateDifferentiableFunction are great tools if one needs
to investigate the whole function but are not convenient if one just needs derivative in a
given point.
> Perhaps you could add some helper methods to FiniteDifferencesDifferentiator or to utility
class like FunctionUtils. Also it would be good to have helper methods to get the derivatives
of UnivariateDifferentiableFunction or MultivariateDifferentiableFunction as simple Univariate
or Multivariate functions (or vector-functions).

This message was sent by Atlassian JIRA

View raw message