Interface CurveDefinition
-
- All Known Subinterfaces:
NodalCurveDefinition
- All Known Implementing Classes:
InterpolatedNodalCurveDefinition
,ParameterizedFunctionalCurveDefinition
public interface CurveDefinition
Provides the definition of how to calibrate a curve.A curve is built from a number of parameters and described by metadata. Calibration is based on a list of
CurveNode
instances that specify the underlying instruments.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Curve
curve(LocalDate valuationDate, CurveMetadata metadata, DoubleArray parameters)
Creates the curve from an array of parameter values.CurveDefinition
filtered(LocalDate valuationDate, ReferenceData refData)
Returns a filtered version of this definition with no invalid nodes.CurveName
getName()
Gets the curve name.ImmutableList<CurveNode>
getNodes()
Gets the nodes that define the curve.int
getParameterCount()
Gets the number of parameters in the curve.ValueType
getYValueType()
Gets the y-value type, providing meaning to the y-values of the curve.ImmutableList<Double>
initialGuess(MarketData marketData)
Gets the list of all initial guesses.CurveMetadata
metadata(LocalDate valuationDate, ReferenceData refData)
Creates the curve metadata.default CurveParameterSize
toCurveParameterSize()
Converts this definition to the summary form.
-
-
-
Method Detail
-
getName
CurveName getName()
Gets the curve name.- Returns:
- the curve name
-
getParameterCount
int getParameterCount()
Gets the number of parameters in the curve.This returns the number of parameters in the curve, which is not necessarily equal the size of
getNodes()
.- Returns:
- the number of parameters
-
getYValueType
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
.- Returns:
- the y-value type
-
getNodes
ImmutableList<CurveNode> getNodes()
Gets the nodes that define the curve.The nodes are used to calibrate the curve. If the objective curve is a nodal curve, each node is used to produce a parameter in the final curve.
- Returns:
- the nodes
-
filtered
CurveDefinition filtered(LocalDate valuationDate, ReferenceData refData)
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
.- Parameters:
valuationDate
- the valuation daterefData
- the reference data- Returns:
- the resolved definition, that should be used in preference to this one
- Throws:
IllegalArgumentException
- if the curve nodes are invalid
-
metadata
CurveMetadata metadata(LocalDate valuationDate, ReferenceData refData)
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.
- Parameters:
valuationDate
- the valuation daterefData
- the reference data- Returns:
- the metadata
-
curve
Curve curve(LocalDate valuationDate, CurveMetadata metadata, DoubleArray parameters)
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.
- Parameters:
valuationDate
- the valuation datemetadata
- the curve metadataparameters
- the array of parameters- Returns:
- the curve
-
toCurveParameterSize
default CurveParameterSize toCurveParameterSize()
Converts this definition to the summary form.The
CurveParameterSize
class provides a summary of this definition consisting of the name and parameter size.- Returns:
- the summary form
-
initialGuess
ImmutableList<Double> initialGuess(MarketData marketData)
Gets the list of all initial guesses.This returns initial guess for the curve parameters. The valuation date is defined by the market data.
- Parameters:
marketData
- the market data required to build a trade for the instrument, including the valuation date- Returns:
- the initial guess
-
-