public interface Surface extends ParameterizedData
double x-value and y-value to a double z-value.
Implementations of this interface provide the ability to find a z-value on the surface from the x-value and y-value.
Each implementation will be backed by a number of parameters. The meaning of the parameters is implementation dependent. The sensitivity of the result to each of the parameters can also be obtained.
InterpolatedNodalSurface| Modifier and Type | Method and Description |
|---|---|
default CurrencyParameterSensitivity |
createParameterSensitivity(Currency currency,
DoubleArray sensitivities)
Creates a parameter sensitivity instance for this surface when the sensitivity values are known.
|
default UnitParameterSensitivity |
createParameterSensitivity(DoubleArray sensitivities)
Creates a parameter sensitivity instance for this surface when the sensitivity values are known.
|
default OptionalInt |
findParameterIndex(ParameterMetadata metadata)
Finds the parameter index of the specified metadata.
|
ValueDerivatives |
firstPartialDerivatives(double x,
double y)
Computes the partial derivatives of the surface.
|
SurfaceMetadata |
getMetadata()
Gets the surface metadata.
|
default SurfaceName |
getName()
Gets the surface name.
|
default ParameterMetadata |
getParameterMetadata(int parameterIndex)
Gets the metadata of the parameter at the specified index.
|
Surface |
withMetadata(SurfaceMetadata metadata)
Returns a new surface with the specified metadata.
|
Surface |
withParameter(int parameterIndex,
double newValue)
Returns a copy of the data with the value at the specified index altered.
|
default Surface |
withPerturbation(ParameterPerturbation perturbation)
Returns a perturbed copy of the data.
|
double |
zValue(double x,
double y)
Computes the z-value for the specified x-value and y-value.
|
default double |
zValue(DoublesPair xyPair)
Computes the z-value for the specified pair of x-value and y-value.
|
UnitParameterSensitivity |
zValueParameterSensitivity(double x,
double y)
Computes the sensitivity of the z-value with respect to the surface parameters.
|
default UnitParameterSensitivity |
zValueParameterSensitivity(DoublesPair xyPair)
Computes the sensitivity of the z-value with respect to the surface parameters.
|
getParameter, getParameterCountSurfaceMetadata getMetadata()
This method returns metadata about the surface and the surface parameters.
The metadata includes an optional list of parameter metadata. If parameter metadata is present, the size of the list will match the number of parameters of this surface.
Surface withMetadata(SurfaceMetadata metadata)
This allows the metadata of the surface to be changed while retaining all other information. If parameter metadata is present, the size of the list must match the number of parameters of this surface.
metadata - the new metadata for the surfacedefault SurfaceName getName()
default ParameterMetadata getParameterMetadata(int parameterIndex)
ParameterizedDataIf there is no specific parameter metadata, an empty instance will be returned.
getParameterMetadata in interface ParameterizedDataparameterIndex - the zero-based index of the parameter to getdefault OptionalInt findParameterIndex(ParameterMetadata metadata)
ParameterizedDataIf the parameter metadata is not matched, an empty optional will be returned.
findParameterIndex in interface ParameterizedDatametadata - the parameter metadata to find the index ofSurface withParameter(int parameterIndex, double newValue)
ParameterizedDataThis instance is immutable and unaffected by this method call.
withParameter in interface ParameterizedDataparameterIndex - the zero-based index of the parameter to getnewValue - the new value for the specified parameterdefault Surface withPerturbation(ParameterPerturbation perturbation)
ParameterizedDataThe perturbation instance will be invoked once for each parameter in this instance, returning the perturbed value for that parameter. The result of this method is a new instance that is based on those perturbed values.
This instance is immutable and unaffected by this method call.
withPerturbation in interface ParameterizedDataperturbation - the perturbation to applydouble zValue(double x,
double y)
x - the x-value to find the z-value fory - the y-value to find the z-value fordefault double zValue(DoublesPair xyPair)
xyPair - the pair of x-value and y-value to find the z-value forUnitParameterSensitivity zValueParameterSensitivity(double x, double y)
This returns an array with one element for each x-y parameter of the surface. The array contains one a sensitivity value for each parameter used to create the surface.
x - the x-value at which the parameter sensitivity is computedy - the y-value at which the parameter sensitivity is computedRuntimeException - if the sensitivity cannot be calculateddefault UnitParameterSensitivity zValueParameterSensitivity(DoublesPair xyPair)
This returns an array with one element for each x-y parameter of the surface. The array contains one sensitivity value for each parameter used to create the surface.
xyPair - the pair of x-value and y-value at which the parameter sensitivity is computedRuntimeException - if the sensitivity cannot be calculatedValueDerivatives firstPartialDerivatives(double x, double y)
The first derivatives are dz/dx and dz/dy.
The derivatives are in the following order:
x - the x-value at which the partial derivative is takeny - the y-value at which the partial derivative is takenRuntimeException - if the derivative cannot be calculateddefault UnitParameterSensitivity createParameterSensitivity(DoubleArray sensitivities)
In most cases, zValueParameterSensitivity(double, double) should be used and manipulated.
However, it can be useful to create a UnitParameterSensitivity from pre-computed sensitivity values.
sensitivities - the sensitivity values, which must match the parameter count of the surfacedefault CurrencyParameterSensitivity createParameterSensitivity(Currency currency, DoubleArray sensitivities)
In most cases, zValueParameterSensitivity(double, double) should be used and manipulated.
However, it can be useful to create a CurrencyParameterSensitivity from pre-computed sensitivity values.
currency - the currencysensitivities - the sensitivity values, which must match the parameter count of the surfaceCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.