public final class InflationNodalCurve extends Object implements NodalCurve, org.joda.beans.ImmutableBean, Serializable
The curve details with the initial point and the total seasonal adjustment for each month can be directly provided. Alternatively, the curve without the initial point and the seasonality as a month-on-month can be provided and the final curve computed from there.
| Modifier and Type | Class and Description |
|---|---|
static class |
InflationNodalCurve.Meta
The meta-bean for
InflationNodalCurve. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
double |
firstDerivative(double x)
Computes the first derivative of the curve.
|
ShiftType |
getAdjustmentType()
Gets the shift type applied to the unadjusted value and the adjustment.
|
CurveMetadata |
getMetadata()
Gets the curve metadata.
|
double |
getParameter(int parameterIndex)
Gets the value of the parameter at the specified index.
|
int |
getParameterCount()
Gets the number of parameters.
|
ParameterMetadata |
getParameterMetadata(int parameterIndex)
Gets the metadata of the parameter at the specified index.
|
DoubleArray |
getSeasonality()
Gets describes the monthly seasonal adjustments.
|
NodalCurve |
getUnderlying()
Gets the underlying curve, before the seasonality adjustment.
|
DoubleArray |
getXValues()
Gets the known x-values of the curve.
|
DoubleArray |
getYValues()
Gets the known y-values of the curve.
|
int |
hashCode() |
static InflationNodalCurve.Meta |
meta()
The meta-bean for
InflationNodalCurve. |
InflationNodalCurve.Meta |
metaBean() |
static InflationNodalCurve |
of(NodalCurve curve,
DoubleArray seasonality,
ShiftType adjustmentType)
Obtains an instance of the curve.
|
static InflationNodalCurve |
of(NodalCurve curveWithoutFixing,
LocalDate valuationDate,
YearMonth lastMonth,
double lastFixingValue,
SeasonalityDefinition seasonalityDefinition)
Obtains an instance from a curve without initial fixing point and month-on-month seasonal adjustment.
|
String |
toString() |
InflationNodalCurve |
withMetadata(CurveMetadata metadata)
Returns a new curve with the specified metadata.
|
InflationNodalCurve |
withNode(double x,
double y,
ParameterMetadata paramMetadata)
Returns a new curve with an additional node, specifying the parameter metadata.
|
InflationNodalCurve |
withParameter(int parameterIndex,
double newValue)
Returns a copy of the data with the value at the specified index altered.
|
InflationNodalCurve |
withValues(DoubleArray xValues,
DoubleArray yValues)
Returns a new curve with the specified x-values and y-values.
|
InflationNodalCurve |
withYValues(DoubleArray values)
Returns a new curve with the specified values.
|
double |
yValue(double x)
Computes the y-value for the specified x-value.
|
UnitParameterSensitivity |
yValueParameterSensitivity(double x)
Computes the sensitivity of the y-value with respect to the curve parameters.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitvalues, withPerturbationcreateParameterSensitivity, createParameterSensitivity, findParameterIndex, getName, split, withUnderlyingCurvepublic static InflationNodalCurve of(NodalCurve curve, DoubleArray seasonality, ShiftType adjustmentType)
The seasonal adjustment is the total adjustment for each month, starting with January.
See of(NodalCurve, LocalDate, YearMonth, double, SeasonalityDefinition) for
month-on-month adjustments and the adjustment starting point, including locking the last fixing.
curve - the curve with initial fixingseasonality - the total seasonal adjustment for each month, with the first element the January adjustmentadjustmentType - the adjustment typepublic static InflationNodalCurve of(NodalCurve curveWithoutFixing, LocalDate valuationDate, YearMonth lastMonth, double lastFixingValue, SeasonalityDefinition seasonalityDefinition)
The total adjustment is computed by accumulation of the monthly adjustment, starting with no adjustment for the last fixing month.
curveWithoutFixing - the curve without the fixingvaluationDate - the valuation date of the curvelastMonth - the last month for which the fixing is knownlastFixingValue - the value of the last fixingseasonalityDefinition - the seasonality definition, which is made of month-on-month adjustment
and the adjustment typepublic CurveMetadata getMetadata()
CurveThis 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 metadata includes an optional list of parameter metadata. If parameter metadata is present, the size of the list will match the number of parameters of this curve.
getMetadata in interface Curvepublic double yValue(double x)
Curvepublic int getParameterCount()
ParameterizedDataThis returns the number of parameters, which can be used to create a loop to access the other methods on this interface.
getParameterCount in interface ParameterizedDatapublic double getParameter(int parameterIndex)
ParameterizedDatagetParameter in interface ParameterizedDataparameterIndex - the zero-based index of the parameter to getpublic ParameterMetadata getParameterMetadata(int parameterIndex)
NodalCurve
If there is no specific parameter metadata, SimpleCurveParameterMetadata will be created.
getParameterMetadata in interface CurvegetParameterMetadata in interface NodalCurvegetParameterMetadata in interface ParameterizedDataparameterIndex - the zero-based index of the parameter to getpublic DoubleArray getXValues()
NodalCurveThis method returns the fixed x-values used to define the curve. This will be of the same size as the y-values.
getXValues in interface NodalCurvepublic DoubleArray getYValues()
NodalCurveThis method returns the fixed y-values used to define the curve. This will be of the same size as the x-values.
getYValues in interface NodalCurvepublic UnitParameterSensitivity yValueParameterSensitivity(double x)
CurveThis returns an array with one element for each parameter of the curve. The array contains the sensitivity of the y-value at the specified x-value to each parameter.
yValueParameterSensitivity in interface Curvex - the x-value at which the parameter sensitivity is computedpublic double firstDerivative(double x)
Curve
The first derivative is dy/dx.
firstDerivative in interface Curvex - the x-value at which the derivative is takenpublic InflationNodalCurve withMetadata(CurveMetadata metadata)
NodalCurveThis allows the metadata of the curve to be changed while retaining all other information. If parameter metadata is present, the size of the list must match the number of parameters of this curve.
withMetadata in interface CurvewithMetadata in interface NodalCurvemetadata - the new metadata for the curvepublic InflationNodalCurve withYValues(DoubleArray values)
NodalCurveThis allows the y-values of the curve to be changed while retaining the same x-values.
withYValues in interface NodalCurvevalues - the new y-values for the curvepublic InflationNodalCurve withValues(DoubleArray xValues, DoubleArray yValues)
NodalCurveThis allows the x values and y-values of the curve to be changed.
withValues in interface NodalCurvexValues - the new x-values for the curveyValues - the new y-values for the curvepublic InflationNodalCurve withParameter(int parameterIndex, double newValue)
ParameterizedDataThis instance is immutable and unaffected by this method call.
withParameter in interface CurvewithParameter in interface NodalCurvewithParameter in interface ParameterizedDataparameterIndex - the zero-based index of the parameter to getnewValue - the new value for the specified parameterpublic InflationNodalCurve withNode(double x, double y, ParameterMetadata paramMetadata)
NodalCurveThe result will contain the specified node. If the x-value equals an existing x-value, the y-value will be changed. If the x-value does not equal an existing x-value, the node will be added.
The result will only contain the specified parameter metadata if this curve also has parameter meta-data.
withNode in interface NodalCurvex - the new x-valuey - the new y-valueparamMetadata - the new parameter metadatapublic static InflationNodalCurve.Meta meta()
InflationNodalCurve.public InflationNodalCurve.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic NodalCurve getUnderlying()
public DoubleArray getSeasonality()
public ShiftType getAdjustmentType()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.