public final class ParameterizedFunctionalCurveDefinition extends Object implements CurveDefinition, org.joda.beans.ImmutableBean
A parameterized functional 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.
The number of the curve parameters is in general different from the number of the instruments. However, the number mismatch tends to cause the root-finding failure in the curve calibration.
| Modifier and Type | Class and Description |
|---|---|
static class |
ParameterizedFunctionalCurveDefinition.Builder
The bean-builder for
ParameterizedFunctionalCurveDefinition. |
static class |
ParameterizedFunctionalCurveDefinition.Meta
The meta-bean for
ParameterizedFunctionalCurveDefinition. |
| Modifier and Type | Method and Description |
|---|---|
static ParameterizedFunctionalCurveDefinition.Builder |
builder()
Returns a builder used to create an instance of the bean.
|
ParameterizedFunctionalCurve |
curve(LocalDate valuationDate,
CurveMetadata metadata,
DoubleArray parameters)
Creates the curve from an array of parameter values.
|
boolean |
equals(Object obj) |
ParameterizedFunctionalCurveDefinition |
filtered(LocalDate valuationDate,
ReferenceData refData)
Returns a filtered version of this definition with no invalid nodes.
|
Optional<DayCount> |
getDayCount()
Gets the day count, optional.
|
BiFunction<DoubleArray,Double,Double> |
getDerivativeFunction()
Gets the derivative function.
|
ImmutableList<Double> |
getInitialGuess()
Gets the initial guess values for the curve parameters.
|
CurveName |
getName()
Gets the curve name.
|
ImmutableList<CurveNode> |
getNodes()
Gets the nodes of the underlying instruments.
|
int |
getParameterCount()
Gets the number of parameters in the curve.
|
ImmutableList<ParameterMetadata> |
getParameterMetadata()
Gets the parameter metadata of the curve, defaulted to empty metadata instances.
|
BiFunction<DoubleArray,Double,DoubleArray> |
getSensitivityFunction()
Gets the parameter sensitivity function.
|
BiFunction<DoubleArray,Double,Double> |
getValueFunction()
Gets the y-value function.
|
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() |
ImmutableList<Double> |
initialGuess(MarketData marketData)
Gets the list of all initial guesses.
|
static ParameterizedFunctionalCurveDefinition.Meta |
meta()
The meta-bean for
ParameterizedFunctionalCurveDefinition. |
ParameterizedFunctionalCurveDefinition.Meta |
metaBean() |
CurveMetadata |
metadata(LocalDate valuationDate,
ReferenceData refData)
Creates the curve metadata.
|
ParameterizedFunctionalCurveDefinition.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waittoCurveParameterSizepublic ParameterizedFunctionalCurveDefinition filtered(LocalDate valuationDate, ReferenceData refData)
CurveDefinition
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.
filtered in interface CurveDefinitionvaluationDate - the valuation daterefData - the reference datapublic CurveMetadata metadata(LocalDate valuationDate, ReferenceData refData)
CurveDefinitionThis 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.
metadata in interface CurveDefinitionvaluationDate - the valuation daterefData - the reference datapublic ParameterizedFunctionalCurve curve(LocalDate valuationDate, CurveMetadata metadata, DoubleArray parameters)
CurveDefinitionThe meaning of the parameters is determined by the implementation. The size of the array must match the count of parameters.
curve in interface CurveDefinitionvaluationDate - the valuation datemetadata - the curve metadataparameters - the array of parameterspublic int getParameterCount()
CurveDefinition
This returns the number of parameters in the curve, which is not necessarily equal the size of getNodes().
getParameterCount in interface CurveDefinitionpublic ImmutableList<Double> initialGuess(MarketData marketData)
CurveDefinitionThis returns initial guess for the curve parameters. The valuation date is defined by the market data.
initialGuess in interface CurveDefinitionmarketData - the market data required to build a trade for the instrument, including the valuation datepublic static ParameterizedFunctionalCurveDefinition.Meta meta()
ParameterizedFunctionalCurveDefinition.public static ParameterizedFunctionalCurveDefinition.Builder builder()
public ParameterizedFunctionalCurveDefinition.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic CurveName getName()
getName in interface CurveDefinitionpublic ValueType getXValueType()
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.
public ValueType getYValueType()
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.
getYValueType in interface CurveDefinitionpublic Optional<DayCount> getDayCount()
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.
public ImmutableList<CurveNode> getNodes()
The nodes are used to find the quoted values to which the curve is calibrated.
getNodes in interface CurveDefinitionpublic ImmutableList<Double> getInitialGuess()
The size must be the same as the number of the curve parameters.
public ImmutableList<ParameterMetadata> getParameterMetadata()
The size of the list must be the same as the number of the curve parameters.
public BiFunction<DoubleArray,Double,Double> getValueFunction()
The function takes parameters and x-value, then returns y-value.
public BiFunction<DoubleArray,Double,Double> getDerivativeFunction()
The function takes parameters and x-value, then returns the first derivative of y-value with respective to x,
i.e., the gradient of the curve.
public BiFunction<DoubleArray,Double,DoubleArray> getSensitivityFunction()
The function takes parameters and x-value, then returns the sensitivities of y-value to the parameters.
public ParameterizedFunctionalCurveDefinition.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.