public final class RatesCurveGroupDefinition extends Object implements CurveGroupDefinition, org.joda.beans.ImmutableBean, Serializable
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.
Modifier and Type | Class and Description |
---|---|
static class |
RatesCurveGroupDefinition.Meta
The meta-bean for
RatesCurveGroupDefinition . |
Modifier and Type | Method and Description |
---|---|
RatesCurveGroupDefinition |
bindTimeSeries(LocalDate valuationDate,
Map<Index,LocalDateDoubleTimeSeries> tsMap)
Returns a definition that is bound to a time-series.
|
static RatesCurveGroupDefinitionBuilder |
builder()
Returns a mutable builder for building the definition for a curve group.
|
RatesCurveGroupDefinition |
combinedWith(RatesCurveGroupDefinition other)
Combines this definition with another one.
|
RatesCurveGroupId |
createGroupId(ObservableSource source)
Creates an identifier that can be used to resolve this definition.
|
boolean |
equals(Object obj) |
RatesCurveGroupDefinition |
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<CurveName> |
findDiscountCurveName(Currency discountCurrency)
Finds the discount curve name for the specified currency.
|
Optional<RatesCurveGroupEntry> |
findEntry(CurveName curveName)
Finds the entry for the curve with the specified name.
|
Optional<CurveName> |
findForwardCurveName(Index forwardIndex)
Finds the forward curve name for the specified index.
|
ImmutableSet<CurveName> |
findForwardCurveNames(FloatingRateName forwardName)
Finds the forward curve names for the specified floating rate name.
|
ImmutableList<CurveDefinition> |
getCurveDefinitions()
Gets definitions which specify how the curves are calibrated.
|
ImmutableList<RatesCurveGroupEntry> |
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 RatesCurveGroupDefinition.Meta |
meta()
The meta-bean for
RatesCurveGroupDefinition . |
RatesCurveGroupDefinition.Meta |
metaBean() |
ImmutableList<CurveMetadata> |
metadata(LocalDate valuationDate,
ReferenceData refData)
Creates the curve metadata for each definition.
|
static RatesCurveGroupDefinition |
of(CurveGroupName name,
Collection<RatesCurveGroupEntry> entries,
Collection<CurveDefinition> curveDefinitions)
Returns a curve group definition with the specified name and containing the specified entries.
|
static RatesCurveGroupDefinition |
of(CurveGroupName name,
Collection<RatesCurveGroupEntry> 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.
|
RatesCurveGroupDefinitionBuilder |
toBuilder()
Converts to builder.
|
String |
toString() |
RatesCurveGroupDefinition |
withCurveDefinitions(List<CurveDefinition> curveDefinitions)
Returns a copy of this object containing the specified curve definitions.
|
RatesCurveGroupDefinition |
withName(CurveGroupName name)
Returns a copy of this definition with a different name.
|
RatesCurveGroupDefinition |
withSeasonalityDefinitions(Map<CurveName,SeasonalityDefinition> seasonalityDefinitions)
Returns a copy of this object containing the specified seasonality definitions.
|
public static RatesCurveGroupDefinitionBuilder builder()
public static RatesCurveGroupDefinition of(CurveGroupName name, Collection<RatesCurveGroupEntry> entries, Collection<CurveDefinition> curveDefinitions)
The Jacobian matrices are computed. The Present Value sensitivity to Market quotes are not computed.
name
- the name of the curve groupentries
- entries describing the curves in the groupcurveDefinitions
- definitions which specify how the curves are calibratedpublic static RatesCurveGroupDefinition of(CurveGroupName name, Collection<RatesCurveGroupEntry> entries, Collection<CurveDefinition> curveDefinitions, Map<CurveName,SeasonalityDefinition> seasonalityDefinitions)
The Jacobian matrices are computed. The Present Value sensitivity to Market quotes are not computed.
name
- the name of the curve groupentries
- entries describing the curves in the groupcurveDefinitions
- definitions which specify how the curves are calibratedseasonalityDefinitions
- definitions which specify the seasonality to use for different curvespublic RatesCurveGroupId createGroupId(ObservableSource source)
CurveGroupDefinition
createGroupId
in interface CurveGroupDefinition
source
- the source of datapublic RatesCurveGroupDefinition filtered(LocalDate valuationDate, ReferenceData refData)
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.
valuationDate
- the valuation daterefData
- the reference dataIllegalArgumentException
- if the curve nodes are invalidpublic RatesCurveGroupDefinition bindTimeSeries(LocalDate valuationDate, Map<Index,LocalDateDoubleTimeSeries> tsMap)
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.
valuationDate
- the valuation datetsMap
- the map of index to time seriespublic Optional<CurveName> findDiscountCurveName(Currency discountCurrency)
If the curve name is not found, optional empty is returned.
discountCurrency
- the currency to find a discount curve name forpublic Optional<CurveName> findForwardCurveName(Index forwardIndex)
If the curve name is not found, optional empty is returned.
forwardIndex
- the index to find a forward curve name forpublic ImmutableSet<CurveName> findForwardCurveNames(FloatingRateName forwardName)
If the curve name is not found, optional empty is returned.
forwardName
- the floating rate name to find a forward curve name forpublic Optional<RatesCurveGroupEntry> findEntry(CurveName curveName)
If the curve is not found, optional empty is returned.
curveName
- the name of the curvepublic Optional<CurveDefinition> findCurveDefinition(CurveName curveName)
If the curve is not found, optional empty is returned.
curveName
- the name of the curvepublic ImmutableList<CurveMetadata> metadata(LocalDate valuationDate, ReferenceData refData)
This method returns a list of metadata, one for each curve definition.
valuationDate
- the valuation daterefData
- the reference datapublic int getTotalParameterCount()
This returns the total number of parameters in the group, which equals the number of nodes.
The result of resolvedTrades(MarketData, ReferenceData)
, and
initialGuesses(MarketData)
will be of this size.
public ImmutableList<ResolvedTrade> resolvedTrades(MarketData marketData, ReferenceData refData)
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.
marketData
- the market data required to build a trade for the instrument, including the valuation daterefData
- the reference data, used to resolve the tradespublic ImmutableList<Double> initialGuesses(MarketData marketData)
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.
marketData
- the market data required to build a trade for the instrument, including the valuation datepublic RatesCurveGroupDefinition withCurveDefinitions(List<CurveDefinition> curveDefinitions)
Curves are ignored if there is no entry in this definition with the same curve name.
curveDefinitions
- curve definitionspublic RatesCurveGroupDefinition withSeasonalityDefinitions(Map<CurveName,SeasonalityDefinition> seasonalityDefinitions)
Seasonality definitions are ignored if there is no entry in this definition with the same curve name.
seasonalityDefinitions
- seasonality definitionspublic RatesCurveGroupDefinition withName(CurveGroupName name)
name
- the name of the new curve group definitionpublic RatesCurveGroupDefinition combinedWith(RatesCurveGroupDefinition other)
This combines the curve definitions, curve entries and seasonality with those from the other definition. An exception is thrown if unable to merge, such as if the curve definitions clash. The group name will be taken from this definition only. The seasonality will be taken from this definition only if there is a clash. The boolean flags will be combined using logical OR.
other
- the other definitionIllegalArgumentException
- if unable to mergepublic RatesCurveGroupDefinitionBuilder toBuilder()
public static RatesCurveGroupDefinition.Meta meta()
RatesCurveGroupDefinition
.public RatesCurveGroupDefinition.Meta metaBean()
metaBean
in interface org.joda.beans.Bean
public CurveGroupName getName()
getName
in interface CurveGroupDefinition
public ImmutableList<RatesCurveGroupEntry> getEntries()
public ImmutableList<CurveDefinition> getCurveDefinitions()
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.
public ImmutableMap<CurveName,SeasonalityDefinition> getSeasonalityDefinitions()
If a curve linked to a price index does not have an entry in the map, no seasonality is used for that curve.
public boolean isComputeJacobian()
public boolean isComputePvSensitivityToMarketQuote()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.