public final class DeformedSurface extends Object implements Surface, org.joda.beans.ImmutableBean, Serializable
The deformation is applied to Surface, and defined in terms of Function, which returns z-value and
sensitivities to the nodes of the original surface.
Typical application of this class is to represent a surface constructed via model calibration to interpolated
market data, where the market data points and interpolation are stored in originalSurface,
and deformationFunction defines the constructed surface.
| Modifier and Type | Class and Description |
|---|---|
static class |
DeformedSurface.Builder
The bean-builder for
DeformedSurface. |
static class |
DeformedSurface.Meta
The meta-bean for
DeformedSurface. |
| Modifier and Type | Method and Description |
|---|---|
static DeformedSurface.Builder |
builder()
Returns a builder used to create an instance of the bean.
|
boolean |
equals(Object obj) |
ValueDerivatives |
firstPartialDerivatives(double x,
double y)
Computes the partial derivatives of the surface.
|
Function<DoublesPair,ValueDerivatives> |
getDeformationFunction()
Gets the deformation function.
|
SurfaceMetadata |
getMetadata()
Gets the surface metadata.
|
Surface |
getOriginalSurface()
Gets the original surface.
|
double |
getParameter(int parameterIndex)
Gets the value of the parameter at the specified index.
|
int |
getParameterCount()
Gets the number of parameters.
|
ParameterMetadata |
getParameterMetadata(int parameterIndex)
Gets the metadata of the parameter at the specified index.
|
int |
hashCode() |
static DeformedSurface.Meta |
meta()
The meta-bean for
DeformedSurface. |
DeformedSurface.Meta |
metaBean() |
static DeformedSurface |
of(SurfaceMetadata metadata,
Surface originalSurface,
Function<DoublesPair,ValueDerivatives> deformationFunction)
Obtains an instance.
|
DeformedSurface.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
String |
toString() |
DeformedSurface |
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.
|
double |
zValue(double x,
double y)
Computes the z-value for the specified x-value and y-value.
|
UnitParameterSensitivity |
zValueParameterSensitivity(double x,
double y)
Computes the sensitivity of the z-value with respect to the surface parameters.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcreateParameterSensitivity, createParameterSensitivity, findParameterIndex, getName, withPerturbation, zValue, zValueParameterSensitivitypublic int getParameterCount()
ParameterizedDataThis returns the number of parameters, which can be used to create a loop to access the other methods on this interface.
getParameterCount in interface ParameterizedDatapublic DeformedSurface withMetadata(SurfaceMetadata metadata)
SurfaceThis 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.
withMetadata in interface Surfacemetadata - the new metadata for the surfacepublic double getParameter(int parameterIndex)
ParameterizedDatagetParameter in interface ParameterizedDataparameterIndex - the zero-based index of the parameter to getpublic ParameterMetadata getParameterMetadata(int parameterIndex)
ParameterizedDataIf there is no specific parameter metadata, an empty instance will be returned.
getParameterMetadata in interface ParameterizedDatagetParameterMetadata in interface SurfaceparameterIndex - the zero-based index of the parameter to getpublic Surface withParameter(int parameterIndex, double newValue)
ParameterizedDataThis instance is immutable and unaffected by this method call.
withParameter in interface ParameterizedDatawithParameter in interface SurfaceparameterIndex - the zero-based index of the parameter to getnewValue - the new value for the specified parameterpublic double zValue(double x,
double y)
Surfacepublic UnitParameterSensitivity zValueParameterSensitivity(double x, double y)
SurfaceThis 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.
zValueParameterSensitivity in interface Surfacex - the x-value at which the parameter sensitivity is computedy - the y-value at which the parameter sensitivity is computedpublic ValueDerivatives firstPartialDerivatives(double x, double y)
Surface
The first derivatives are dz/dx and dz/dy.
The derivatives are in the following order:
firstPartialDerivatives in interface Surfacex - the x-value at which the partial derivative is takeny - the y-value at which the partial derivative is takenpublic static DeformedSurface of(SurfaceMetadata metadata, Surface originalSurface, Function<DoublesPair,ValueDerivatives> deformationFunction)
metadata - the surface metadataoriginalSurface - the original surfacedeformationFunction - the deformation functionpublic static DeformedSurface.Meta meta()
DeformedSurface.public static DeformedSurface.Builder builder()
public DeformedSurface.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic SurfaceMetadata getMetadata()
The metadata includes an optional list of parameter metadata.
getMetadata in interface Surfacepublic Surface getOriginalSurface()
The underlying surface which receives the deformation defined by deformationFunction.
public Function<DoublesPair,ValueDerivatives> getDeformationFunction()
The deformation to the original surface is define by this function.
The function takes DoublesPair of x-value and y-value, then returns ValueDerivatives
which contains z-value for the specified x,y values, and node sensitivities to the original surface.
public DeformedSurface.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.