public interface Cube extends ParameterizedData
double x-value, y-value, z-value to a double w-value.
Implementations of this interface provide the ability to find a w-value on the cube from the x-value, y-value, z-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.
InterpolatedNodalCube| Modifier and Type | Method and Description |
|---|---|
default CurrencyParameterSensitivity |
createParameterSensitivity(Currency currency,
DoubleArray sensitivities)
Creates a parameter sensitivity instance for this cube when the sensitivity values are known.
|
default UnitParameterSensitivity |
createParameterSensitivity(DoubleArray sensitivities)
Creates a parameter sensitivity instance for this cube 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,
double z)
Computes the partial derivatives of the cube.
|
CubeMetadata |
getMetadata()
Gets the cube metadata.
|
default CubeName |
getName()
Gets the cube name.
|
default ParameterMetadata |
getParameterMetadata(int parameterIndex)
Gets the metadata of the parameter at the specified index.
|
Cube |
withMetadata(CubeMetadata metadata)
Returns a new cube with the specified metadata.
|
Cube |
withParameter(int parameterIndex,
double newValue)
Returns a copy of the data with the value at the specified index altered.
|
default Cube |
withPerturbation(ParameterPerturbation perturbation)
Returns a perturbed copy of the data.
|
double |
wValue(double x,
double y,
double z)
Computes the w-value for the specified x-value, y-value, z-value.
|
UnitParameterSensitivity |
wValueParameterSensitivity(double x,
double y,
double z)
Computes the sensitivity of the w-value with respect to the cube parameters.
|
getParameter, getParameterCountCubeMetadata getMetadata()
This method returns metadata about the cube and the cube 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 cube.
Cube withMetadata(CubeMetadata metadata)
This allows the metadata of the cube 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 cube.
metadata - the new metadata for the cubedefault CubeName 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 ofCube 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 Cube 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 wValue(double x,
double y,
double z)
x - the x-value to find the w-value fory - the y-value to find the w-value forz - the z-value to find the w-value forUnitParameterSensitivity wValueParameterSensitivity(double x, double y, double z)
This returns an array with one element for each x-y-z parameter of the cube. The array contains one a sensitivity value for each parameter used to create the cube.
x - the x-value at which the parameter sensitivity is computedy - the y-value at which the parameter sensitivity is computedz - the z-value at which the parameter sensitivity is computedRuntimeException - if the sensitivity cannot be calculatedValueDerivatives firstPartialDerivatives(double x, double y, double z)
The first derivatives are dw/dx, dw/dy, dw/dz.
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 takenz - the z-value at which the partial derivative is takenRuntimeException - if the derivative cannot be calculateddefault UnitParameterSensitivity createParameterSensitivity(DoubleArray sensitivities)
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 cubedefault CurrencyParameterSensitivity createParameterSensitivity(Currency currency, DoubleArray sensitivities)
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 cubeCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.