Class InterpolatedNodalCurveDefinition
- java.lang.Object
-
- com.opengamma.strata.market.curve.InterpolatedNodalCurveDefinition
-
- All Implemented Interfaces:
CurveDefinition
,NodalCurveDefinition
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class InterpolatedNodalCurveDefinition extends Object implements NodalCurveDefinition, org.joda.beans.ImmutableBean, Serializable
Provides the definition of how to calibrate an interpolated nodal curve.A nodal curve is built from a number of parameters and described by metadata. Calibration is based on a list of
CurveNode
instances, one for each parameter, that specify the underlying instruments.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InterpolatedNodalCurveDefinition.Builder
The bean-builder forInterpolatedNodalCurveDefinition
.static class
InterpolatedNodalCurveDefinition.Meta
The meta-bean forInterpolatedNodalCurveDefinition
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static InterpolatedNodalCurveDefinition.Builder
builder()
Returns a builder used to create an instance of the bean.NodalCurve
curve(LocalDate valuationDate, CurveMetadata metadata, DoubleArray parameters)
Creates the curve from an array of parameter values.boolean
equals(Object obj)
InterpolatedNodalCurveDefinition
filtered(LocalDate valuationDate, ReferenceData refData)
Returns a filtered version of this definition with no invalid nodes.Optional<DayCount>
getDayCount()
Gets the day count, optional.CurveExtrapolator
getExtrapolatorLeft()
Gets the extrapolator used to find points to the left of the leftmost point on the curve.CurveExtrapolator
getExtrapolatorRight()
Gets the extrapolator used to find points to the right of the rightmost point on the curve.CurveInterpolator
getInterpolator()
Gets the interpolator used to find points on the curve.CurveName
getName()
Gets the curve name.ImmutableList<CurveNode>
getNodes()
Gets the nodes in the curve.ValueType
getXValueType()
Gets the x-value type, providing meaning to the x-values of the curve.ValueType
getYValueType()
Gets the y-value type, providing meaning to the y-values of the curve.int
hashCode()
static InterpolatedNodalCurveDefinition.Meta
meta()
The meta-bean forInterpolatedNodalCurveDefinition
.InterpolatedNodalCurveDefinition.Meta
metaBean()
CurveMetadata
metadata(LocalDate valuationDate, ReferenceData refData)
Creates the curve metadata.InterpolatedNodalCurveDefinition.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.market.curve.CurveDefinition
toCurveParameterSize
-
Methods inherited from interface com.opengamma.strata.market.curve.NodalCurveDefinition
getParameterCount, initialGuess
-
-
-
-
Method Detail
-
filtered
public InterpolatedNodalCurveDefinition filtered(LocalDate valuationDate, ReferenceData refData)
Description copied from interface:CurveDefinition
Returns a filtered version of this definition with no invalid nodes.A curve is formed of a number of nodes, each of which has an associated date. To be valid, the curve node dates must be in order from earliest to latest. Each node has certain rules,
CurveNodeDateOrder
, that are used to determine what happens if the date of one curve node is equal or earlier than the date of the previous node.Filtering occurs in two stages. The first stage looks at each node in turn. The previous and next nodes are checked for clash. If clash occurs, then one of the two nodes is dropped according to the clash action "drop" values. The second stage then looks again at the nodes, and if there are still any invalid nodes, an exception is thrown.
This approach means that in most cases, only those nodes that have fixed dates, such as futures, need to be annotated with
CurveNodeDateOrder
.- Specified by:
filtered
in interfaceCurveDefinition
- Specified by:
filtered
in interfaceNodalCurveDefinition
- Parameters:
valuationDate
- the valuation daterefData
- the reference data- Returns:
- the resolved definition, that should be used in preference to this one
-
metadata
public CurveMetadata metadata(LocalDate valuationDate, ReferenceData refData)
Description copied from interface:CurveDefinition
Creates the curve metadata.This method returns metadata about the curve and the curve parameters.
For example, a curve may be defined based on financial instruments. The parameters might represent 1 day, 1 week, 1 month, 3 months, 6 months and 12 months. The metadata could be used to describe each parameter in terms of a
Period
.The optional parameter-level metadata will be populated on the resulting metadata. The size of the parameter-level metadata will match the number of parameters of this curve.
- Specified by:
metadata
in interfaceCurveDefinition
- Parameters:
valuationDate
- the valuation daterefData
- the reference data- Returns:
- the metadata
-
curve
public NodalCurve curve(LocalDate valuationDate, CurveMetadata metadata, DoubleArray parameters)
Description copied from interface:CurveDefinition
Creates the curve from an array of parameter values.The meaning of the parameters is determined by the implementation. The size of the array must match the count of parameters.
- Specified by:
curve
in interfaceCurveDefinition
- Specified by:
curve
in interfaceNodalCurveDefinition
- Parameters:
valuationDate
- the valuation datemetadata
- the curve metadataparameters
- the array of parameters- Returns:
- the curve
-
meta
public static InterpolatedNodalCurveDefinition.Meta meta()
The meta-bean forInterpolatedNodalCurveDefinition
.- Returns:
- the meta-bean, not null
-
builder
public static InterpolatedNodalCurveDefinition.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public InterpolatedNodalCurveDefinition.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getName
public CurveName getName()
Gets the curve name.- Specified by:
getName
in interfaceCurveDefinition
- Returns:
- the value of the property, not null
-
getXValueType
public ValueType getXValueType()
Gets the x-value type, providing meaning to the x-values of the curve.This type provides meaning to the x-values. For example, the x-value might represent a year fraction, as represented using
ValueType.YEAR_FRACTION
.If using the builder, this defaults to
ValueType.UNKNOWN
.- Returns:
- the value of the property, not null
-
getYValueType
public ValueType getYValueType()
Gets the y-value type, providing meaning to the y-values of the curve.This type provides meaning to the y-values. For example, the y-value might represent a zero rate, as represented using
ValueType.ZERO_RATE
.If using the builder, this defaults to
ValueType.UNKNOWN
.- Specified by:
getYValueType
in interfaceCurveDefinition
- Returns:
- the value of the property, not null
-
getDayCount
public Optional<DayCount> getDayCount()
Gets the day count, optional.If the x-value of the curve represents time as a year fraction, the day count can be specified to define how the year fraction is calculated.
- Returns:
- the optional value of the property, not null
-
getNodes
public ImmutableList<CurveNode> getNodes()
Gets the nodes in the curve.The nodes are used to find the par rates and calibrate the curve. There must be at least two nodes in the curve.
- Specified by:
getNodes
in interfaceCurveDefinition
- Returns:
- the value of the property, not null
-
getInterpolator
public CurveInterpolator getInterpolator()
Gets the interpolator used to find points on the curve.- Returns:
- the value of the property, not null
-
getExtrapolatorLeft
public CurveExtrapolator getExtrapolatorLeft()
Gets the extrapolator used to find points to the left of the leftmost point on the curve.- Returns:
- the value of the property, not null
-
getExtrapolatorRight
public CurveExtrapolator getExtrapolatorRight()
Gets the extrapolator used to find points to the right of the rightmost point on the curve.- Returns:
- the value of the property, not null
-
toBuilder
public InterpolatedNodalCurveDefinition.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-