public class VectorFieldFirstOrderDifferentiator extends Object implements Differentiator<DoubleArray,DoubleArray,DoubleMatrix>
For a function $\mathbf{y} = f(\mathbf{x})$ where $\mathbf{x}$ is a n-dimensional vector and $\mathbf{y}$ is a m-dimensional vector, this class produces the Jacobian function $\mathbf{J}(\mathbf{x})$, i.e. a function that returns the Jacobian for each point $\mathbf{x}$, where $\mathbf{J}$ is the $m \times n$ matrix $\frac{dy_i}{dx_j}$
| Constructor and Description |
|---|
VectorFieldFirstOrderDifferentiator()
Creates an instance using the default value of eps (10-5) and central differencing type.
|
VectorFieldFirstOrderDifferentiator(double eps)
Creates an instance using the central differencing type.
|
VectorFieldFirstOrderDifferentiator(FiniteDifferenceType differenceType)
Creates an instance using the default value of eps (10-5).
|
VectorFieldFirstOrderDifferentiator(FiniteDifferenceType differenceType,
double eps)
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
Function<DoubleArray,DoubleMatrix> |
differentiate(Function<DoubleArray,DoubleArray> function)
Provides a function that performs the differentiation.
|
Function<DoubleArray,DoubleMatrix> |
differentiate(Function<DoubleArray,DoubleArray> function,
Function<DoubleArray,Boolean> domain)
Provides a function that performs the differentiation.
|
public VectorFieldFirstOrderDifferentiator()
public VectorFieldFirstOrderDifferentiator(FiniteDifferenceType differenceType)
differenceType - the differencing type to be used in calculating the gradient functionpublic VectorFieldFirstOrderDifferentiator(double eps)
If the size of the domain is very small or very large, consider re-scaling first. If this value is too small, the result will most likely be dominated by noise. Use around 10-5 times the domain size.
eps - the step size used to approximate the derivativepublic VectorFieldFirstOrderDifferentiator(FiniteDifferenceType differenceType, double eps)
If the size of the domain is very small or very large, consider re-scaling first. If this value is too small, the result will most likely be dominated by noise. Use around 10-5 times the domain size.
differenceType - the differencing type to be used in calculating the gradient functioneps - the step size used to approximate the derivativepublic Function<DoubleArray,DoubleMatrix> differentiate(Function<DoubleArray,DoubleArray> function)
Differentiatordifferentiate in interface Differentiator<DoubleArray,DoubleArray,DoubleMatrix>function - a function for which to get the differential functionpublic Function<DoubleArray,DoubleMatrix> differentiate(Function<DoubleArray,DoubleArray> function, Function<DoubleArray,Boolean> domain)
Differentiatordifferentiate in interface Differentiator<DoubleArray,DoubleArray,DoubleMatrix>function - a function for which to get the differential functiondomain - a function that returns false if the requested value is not in the domain, true otherwiseCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.