Class DeformedSurface
- java.lang.Object
 - 
- com.opengamma.strata.market.surface.DeformedSurface
 
 
- 
- All Implemented Interfaces:
 ParameterizedData,Surface,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class DeformedSurface extends Object implements Surface, org.joda.beans.ImmutableBean, Serializable
The deformed surface.The deformation is applied to
Surface, and defined in terms ofFunction, 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, anddeformationFunctiondefines the constructed surface.- See Also:
 - Serialized Form
 
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDeformedSurface.BuilderThe bean-builder forDeformedSurface.static classDeformedSurface.MetaThe meta-bean forDeformedSurface. 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DeformedSurface.Builderbuilder()Returns a builder used to create an instance of the bean.booleanequals(Object obj)ValueDerivativesfirstPartialDerivatives(double x, double y)Computes the partial derivatives of the surface.Function<DoublesPair,ValueDerivatives>getDeformationFunction()Gets the deformation function.SurfaceMetadatagetMetadata()Gets the surface metadata.SurfacegetOriginalSurface()Gets the original surface.doublegetParameter(int parameterIndex)Gets the value of the parameter at the specified index.intgetParameterCount()Gets the number of parameters.ParameterMetadatagetParameterMetadata(int parameterIndex)Gets the metadata of the parameter at the specified index.inthashCode()static DeformedSurface.Metameta()The meta-bean forDeformedSurface.DeformedSurface.MetametaBean()static DeformedSurfaceof(SurfaceMetadata metadata, Surface originalSurface, Function<DoublesPair,ValueDerivatives> deformationFunction)Obtains an instance.DeformedSurface.BuildertoBuilder()Returns a builder that allows this bean to be mutated.StringtoString()DeformedSurfacewithMetadata(SurfaceMetadata metadata)Returns a new surface with the specified metadata.SurfacewithParameter(int parameterIndex, double newValue)Returns a copy of the data with the value at the specified index altered.doublezValue(double x, double y)Computes the z-value for the specified x-value and y-value.UnitParameterSensitivityzValueParameterSensitivity(double x, double y)Computes the sensitivity of the z-value with respect to the surface parameters.- 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait 
- 
Methods inherited from interface com.opengamma.strata.market.surface.Surface
createParameterSensitivity, createParameterSensitivity, findParameterIndex, getName, withPerturbation, zValue, zValueParameterSensitivity 
 - 
 
 - 
 
- 
- 
Method Detail
- 
getParameterCount
public int getParameterCount()
Description copied from interface:ParameterizedDataGets the number of parameters.This returns the number of parameters, which can be used to create a loop to access the other methods on this interface.
- Specified by:
 getParameterCountin interfaceParameterizedData- Returns:
 - the number of parameters
 
 
- 
withMetadata
public DeformedSurface withMetadata(SurfaceMetadata metadata)
Description copied from interface:SurfaceReturns a new surface with the specified 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.
- Specified by:
 withMetadatain interfaceSurface- Parameters:
 metadata- the new metadata for the surface- Returns:
 - the new surface
 
 
- 
getParameter
public double getParameter(int parameterIndex)
Description copied from interface:ParameterizedDataGets the value of the parameter at the specified index.- Specified by:
 getParameterin interfaceParameterizedData- Parameters:
 parameterIndex- the zero-based index of the parameter to get- Returns:
 - the value of the parameter
 
 
- 
getParameterMetadata
public ParameterMetadata getParameterMetadata(int parameterIndex)
Description copied from interface:ParameterizedDataGets the metadata of the parameter at the specified index.If there is no specific parameter metadata, an empty instance will be returned.
- Specified by:
 getParameterMetadatain interfaceParameterizedData- Specified by:
 getParameterMetadatain interfaceSurface- Parameters:
 parameterIndex- the zero-based index of the parameter to get- Returns:
 - the metadata of the parameter
 
 
- 
withParameter
public Surface withParameter(int parameterIndex, double newValue)
Description copied from interface:ParameterizedDataReturns a copy of the data with the value at the specified index altered.This instance is immutable and unaffected by this method call.
- Specified by:
 withParameterin interfaceParameterizedData- Specified by:
 withParameterin interfaceSurface- Parameters:
 parameterIndex- the zero-based index of the parameter to getnewValue- the new value for the specified parameter- Returns:
 - a parameterized data instance based on this with the specified parameter altered
 
 
- 
zValue
public double zValue(double x, double y)Description copied from interface:SurfaceComputes the z-value for the specified x-value and y-value. 
- 
zValueParameterSensitivity
public UnitParameterSensitivity zValueParameterSensitivity(double x, double y)
Description copied from interface:SurfaceComputes the sensitivity of the z-value with respect to the surface parameters.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.
- Specified by:
 zValueParameterSensitivityin interfaceSurface- Parameters:
 x- the x-value at which the parameter sensitivity is computedy- the y-value at which the parameter sensitivity is computed- Returns:
 - the sensitivity at the x/y/ point
 
 
- 
firstPartialDerivatives
public ValueDerivatives firstPartialDerivatives(double x, double y)
Description copied from interface:SurfaceComputes the partial derivatives of the surface.The first derivatives are
dz/dx and dz/dy. The derivatives are in the following order:- [0] derivative with respect to x
 - [1] derivative with respect to y
 
- Specified by:
 firstPartialDerivativesin interfaceSurface- Parameters:
 x- the x-value at which the partial derivative is takeny- the y-value at which the partial derivative is taken- Returns:
 - the z-value and it's partial first derivatives
 
 
- 
of
public static DeformedSurface of(SurfaceMetadata metadata, Surface originalSurface, Function<DoublesPair,ValueDerivatives> deformationFunction)
Obtains an instance.- Parameters:
 metadata- the surface metadataoriginalSurface- the original surfacedeformationFunction- the deformation function- Returns:
 - the surface
 
 
- 
meta
public static DeformedSurface.Meta meta()
The meta-bean forDeformedSurface.- Returns:
 - the meta-bean, not null
 
 
- 
builder
public static DeformedSurface.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
 - the builder, not null
 
 
- 
metaBean
public DeformedSurface.Meta metaBean()
- Specified by:
 metaBeanin interfaceorg.joda.beans.Bean
 
- 
getMetadata
public SurfaceMetadata getMetadata()
Gets the surface metadata.The metadata includes an optional list of parameter metadata.
- Specified by:
 getMetadatain interfaceSurface- Returns:
 - the value of the property, not null
 
 
- 
getOriginalSurface
public Surface getOriginalSurface()
Gets the original surface.The underlying surface which receives the deformation defined by
deformationFunction.- Returns:
 - the value of the property, not null
 
 
- 
getDeformationFunction
public Function<DoublesPair,ValueDerivatives> getDeformationFunction()
Gets the deformation function.The deformation to the original surface is define by this function. The function takes
DoublesPairof x-value and y-value, then returnsValueDerivativeswhich contains z-value for the specified x,y values, and node sensitivities to the original surface.- Returns:
 - the value of the property, not null
 
 
- 
toBuilder
public DeformedSurface.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
 - the mutable builder, not null
 
 
 - 
 
 -