com.opengamma.strata.market.curve

## Class CurveGroupDefinition

• All Implemented Interfaces:
Serializable, Bean, ImmutableBean

public final class CurveGroupDefinition
extends Object
implements ImmutableBean, Serializable
Provides the definition of how to calibrate a group of curves.

A curve group contains one or more entries, each of which contains the definition of a curve and a set of currencies and indices specifying how the curve is to be used. The currencies are used to specify that the curve is to be used as a discount curve. The indices are used to specify that the curve is to be used as a forward curve.

Serialized Form
• ### Nested Class Summary

Nested Classes
Modifier and Type Class and Description
static class  CurveGroupDefinition.Meta
The meta-bean for CurveGroupDefinition.
• ### Method Summary

All Methods
Modifier and Type Method and Description
CurveGroupDefinition bindTimeSeries(LocalDate valuationDate, Map<Index,LocalDateDoubleTimeSeries> tsMap)
Returns a definition that is bound to a time-series.
static CurveGroupDefinitionBuilder builder()
Returns a mutable builder for building the definition for a curve group.
boolean equals(Object obj)
CurveGroupDefinition filtered(LocalDate valuationDate, ReferenceData refData)
Returns a filtered version of this definition with no invalid nodes.
Optional<CurveDefinition> findCurveDefinition(CurveName curveName)
Finds the definition for the curve with the specified name.
Optional<CurveGroupEntry> findEntry(CurveName curveName)
Finds the entry for the curve with the specified name.
ImmutableList<CurveDefinition> getCurveDefinitions()
Gets definitions which specify how the curves are calibrated.
ImmutableList<CurveGroupEntry> getEntries()
Gets the configuration for building the curves in the group.
CurveGroupName getName()
Gets the name of the curve group.
ImmutableMap<CurveName,SeasonalityDefinition> getSeasonalityDefinitions()
Gets definitions which specify which seasonality should be used for some price index curves.
int getTotalParameterCount()
Gets the total number of parameters in the group.
int hashCode()
ImmutableList<Double> initialGuesses(MarketData marketData)
Gets the list of all initial guesses.
boolean isComputeJacobian()
Gets the flag indicating if the Jacobian matrices should be computed and stored in metadata or not.
boolean isComputePvSensitivityToMarketQuote()
Gets the flag indicating if present value sensitivity to market quotes should be computed and stored in metadata or not.
static CurveGroupDefinition.Meta meta()
The meta-bean for CurveGroupDefinition.
CurveGroupDefinition.Meta metaBean()
ImmutableList<CurveMetadata> metadata(LocalDate valuationDate, ReferenceData refData)
Creates the curve metadata for each definition.
static CurveGroupDefinition of(CurveGroupName name, Collection<CurveGroupEntry> entries, Collection<CurveDefinition> curveDefinitions)
Returns a curve group definition with the specified name and containing the specified entries.
static CurveGroupDefinition of(CurveGroupName name, Collection<CurveGroupEntry> entries, Collection<CurveDefinition> curveDefinitions, Map<CurveName,SeasonalityDefinition> seasonalityDefinitions)
Returns a curve group definition with the specified name and containing the specified entries and seasonality.
ImmutableList<ResolvedTrade> resolvedTrades(MarketData marketData, ReferenceData refData)
Creates a list of trades representing the instrument at each node.
CurveGroupDefinitionBuilder toBuilder()
Converts to builder.
String toString()
CurveGroupDefinition withCurveDefinitions(List<CurveDefinition> curveDefinitions)
Returns a copy of this object containing the specified curve definitions.
CurveGroupDefinition withName(CurveGroupName name)
Returns a copy of this definition with a different name.
CurveGroupDefinition withSeasonalityDefinitions(Map<CurveName,SeasonalityDefinition> seasonalityDefinitions)
Returns a copy of this object containing the specified seasonality definitions.
• ### Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait
• ### Methods inherited from interface org.joda.beans.Bean

property, propertyNames
• ### Method Detail

• #### builder

public static CurveGroupDefinitionBuilder builder()
Returns a mutable builder for building the definition for a curve group.
Returns:
a mutable builder for building the definition for a curve group
• #### of

public static CurveGroupDefinition of(CurveGroupName name,
Collection<CurveGroupEntry> entries,
Collection<CurveDefinition> curveDefinitions)
Returns a curve group definition with the specified name and containing the specified entries.

The Jacobian matrices are computed. The Present Value sensitivity to Market quotes are not computed.

Parameters:
name - the name of the curve group
entries - entries describing the curves in the group
curveDefinitions - definitions which specify how the curves are calibrated
Returns:
a curve group definition with the specified name and containing the specified entries
• #### of

public static CurveGroupDefinition of(CurveGroupName name,
Collection<CurveGroupEntry> entries,
Collection<CurveDefinition> curveDefinitions,
Map<CurveName,SeasonalityDefinition> seasonalityDefinitions)
Returns a curve group definition with the specified name and containing the specified entries and seasonality.

The Jacobian matrices are computed. The Present Value sensitivity to Market quotes are not computed.

Parameters:
name - the name of the curve group
entries - entries describing the curves in the group
curveDefinitions - definitions which specify how the curves are calibrated
seasonalityDefinitions - definitions which specify the seasonality to use for different curves
Returns:
a curve group definition with the specified name and containing the specified entries
• #### filtered

public CurveGroupDefinition 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. This method applies rules to remove invalid nodes.

Parameters:
valuationDate - the valuation date
refData - the reference data
Returns:
the resolved definition, that should be used in preference to this one
Throws:
IllegalArgumentException - if the curve nodes are invalid
• #### bindTimeSeries

public CurveGroupDefinition bindTimeSeries(LocalDate valuationDate,
Map<Index,LocalDateDoubleTimeSeries> tsMap)
Returns a definition that is bound to a time-series.

Curves related to a price index are better described when a starting point is added with the last fixing in the time series. This method finds price index curves, and ensures that they are unique (not used for any other index or discounting). Each price index curve is then bound to the matching time-series with the last fixing month equal to the last element in the time series which is in the past.

Parameters:
valuationDate - the valuation date
tsMap - the map of index to time series
Returns:
the new instance
• #### findEntry

public Optional<CurveGroupEntry> findEntry(CurveName curveName)
Finds the entry for the curve with the specified name.

Parameters:
curveName - the name of the curve
Returns:
the entry for the curve with the specified name
• #### findCurveDefinition

public Optional<CurveDefinition> findCurveDefinition(CurveName curveName)
Finds the definition for the curve with the specified name.

Parameters:
curveName - the name of the curve
Returns:
the definition for the curve with the specified name

public ImmutableList<CurveMetadata> metadata(LocalDate valuationDate,
ReferenceData refData)
Creates the curve metadata for each definition.

This method returns a list of metadata, one for each curve definition.

Parameters:
valuationDate - the valuation date
refData - the reference data
Returns:

public ImmutableList<ResolvedTrade> resolvedTrades(MarketData marketData,
ReferenceData refData)
Creates a list of trades representing the instrument at each node.

This uses the observed market data to build the trade that each node represents. The result combines the list of trades from each curve in order. Each trade is created with a quantity of 1. 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
refData - the reference data, used to resolve the trades
Returns:
• #### initialGuesses

public ImmutableList<Double> initialGuesses(MarketData marketData)
Gets the list of all initial guesses.

This returns a list that combines the list of initial guesses from each curve in order. 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 list of all initial guesses
• #### withCurveDefinitions

public CurveGroupDefinition withCurveDefinitions(List<CurveDefinition> curveDefinitions)
Returns a copy of this object containing the specified curve definitions.

Curves are ignored if there is no entry in this definition with the same curve name.

Parameters:
curveDefinitions - curve definitions
Returns:
a copy of this object containing the specified curve definitions
• #### withSeasonalityDefinitions

public CurveGroupDefinition withSeasonalityDefinitions(Map<CurveName,SeasonalityDefinition> seasonalityDefinitions)
Returns a copy of this object containing the specified seasonality definitions.

Seasonality definitions are ignored if there is no entry in this definition with the same curve name.

Parameters:
seasonalityDefinitions - seasonality definitions
Returns:
a copy of this object containing the specified seasonality definitions
• #### withName

public CurveGroupDefinition withName(CurveGroupName name)
Returns a copy of this definition with a different name.
Parameters:
name - the name of the new curve group definition
Returns:
a copy of this curve group definition with a different name
• #### toBuilder

public CurveGroupDefinitionBuilder toBuilder()
Converts to builder.
Returns:
the builder
• #### meta

public static CurveGroupDefinition.Meta meta()
The meta-bean for CurveGroupDefinition.
Returns:
the meta-bean, not null
• #### metaBean

public CurveGroupDefinition.Meta metaBean()
Specified by:
metaBean in interface Bean
• #### getName

public CurveGroupName getName()
Gets the name of the curve group.
Returns:
the value of the property, not null
• #### getEntries

public ImmutableList<CurveGroupEntry> getEntries()
Gets the configuration for building the curves in the group.
Returns:
the value of the property, not null
• #### getCurveDefinitions

public ImmutableList<CurveDefinition> getCurveDefinitions()
Gets definitions which specify how the curves are calibrated.

Curve definitions are required for curves that need to be calibrated. A definition is not necessary if the curve is not built by the Strata curve calibrator.

Returns:
the value of the property, not null
• #### getSeasonalityDefinitions

public ImmutableMap<CurveName,SeasonalityDefinition> getSeasonalityDefinitions()
Gets definitions which specify which seasonality should be used for some price index curves.

If a curve linked to a price index does not have an entry in the map, no seasonality is used for that curve.

Returns:
the value of the property, not null
• #### isComputeJacobian

public boolean isComputeJacobian()
Gets the flag indicating if the Jacobian matrices should be computed and stored in metadata or not.
Returns:
the value of the property
• #### isComputePvSensitivityToMarketQuote

public boolean isComputePvSensitivityToMarketQuote()
Gets the flag indicating if present value sensitivity to market quotes should be computed and stored in metadata or not.
Returns:
the value of the property
• #### equals

public boolean equals(Object obj)
Overrides:
equals in class Object
• #### hashCode

public int hashCode()
Overrides:
hashCode in class Object
• #### toString

public String toString()
Overrides:
toString in class Object