public final class SimplePriceIndexValues extends Object implements PriceIndexValues, org.joda.beans.ImmutableBean, Serializable
This provides historic and forward rates for a single PriceIndex, such as 'US-CPI-U'.
This implementation is based on an underlying forward curve.
Seasonality is included in the curve, see InflationNodalCurve.
| Modifier and Type | Class and Description |
|---|---|
static class |
SimplePriceIndexValues.Meta
The meta-bean for
SimplePriceIndexValues. |
| Modifier and Type | Method and Description |
|---|---|
CurrencyParameterSensitivities |
createParameterSensitivity(Currency currency,
DoubleArray sensitivities)
Creates the parameter sensitivity when the sensitivity values are known.
|
boolean |
equals(Object obj) |
<T> Optional<T> |
findData(MarketDataName<T> name) |
OptionalInt |
findParameterIndex(ParameterMetadata metadata) |
Curve |
getCurve()
Gets the underlying curve.
|
LocalDateDoubleTimeSeries |
getFixings()
Gets the monthly time-series of fixings.
|
PriceIndex |
getIndex()
Gets the index that the values are for.
|
double |
getParameter(int parameterIndex) |
int |
getParameterCount() |
ParameterMetadata |
getParameterMetadata(int parameterIndex) |
LocalDate |
getValuationDate()
Gets the valuation date.
|
int |
hashCode() |
static SimplePriceIndexValues.Meta |
meta()
The meta-bean for
SimplePriceIndexValues. |
SimplePriceIndexValues.Meta |
metaBean() |
static SimplePriceIndexValues |
of(PriceIndex index,
LocalDate valuationDate,
Curve curve,
LocalDateDoubleTimeSeries fixings)
Obtains an instance based on a curve with no seasonality adjustment.
|
CurrencyParameterSensitivities |
parameterSensitivity(InflationRateSensitivity pointSensitivity)
Calculates the parameter sensitivity from the point sensitivity.
|
String |
toString() |
double |
value(PriceIndexObservation observation)
Gets the historic or forward rate at the specified fixing month.
|
PointSensitivityBuilder |
valuePointSensitivity(PriceIndexObservation observation)
Calculates the point sensitivity of the historic or forward value at the specified fixing month.
|
SimplePriceIndexValues |
withCurve(Curve curve)
Returns a new instance with a different curve.
|
SimplePriceIndexValues |
withParameter(int parameterIndex,
double newValue) |
SimplePriceIndexValues |
withPerturbation(ParameterPerturbation perturbation) |
public static SimplePriceIndexValues of(PriceIndex index, LocalDate valuationDate, Curve curve, LocalDateDoubleTimeSeries fixings)
Each x-value on the curve is the number of months between the valuation month and the estimation month. For example, zero represents the valuation month, one the next month and so on.
The time-series contains one value per month and must have at least one entry. The value is stored in the time-series on the last date of each month (which may be a non-working day).
The curve will be altered to be consistent with the time-series. The last element of the series is added as the first point of the interpolated curve to ensure a coherent transition.
of in interface PriceIndexValuesindex - the Price indexvaluationDate - the valuation date for which the curve is validfixings - the time-series of fixingscurve - the underlying forward curve for index estimationpublic <T> Optional<T> findData(MarketDataName<T> name)
findData in interface MarketDataViewpublic int getParameterCount()
getParameterCount in interface ParameterizedDatapublic double getParameter(int parameterIndex)
getParameter in interface ParameterizedDatapublic ParameterMetadata getParameterMetadata(int parameterIndex)
getParameterMetadata in interface ParameterizedDatapublic OptionalInt findParameterIndex(ParameterMetadata metadata)
findParameterIndex in interface ParameterizedDatapublic SimplePriceIndexValues withParameter(int parameterIndex, double newValue)
withParameter in interface ParameterizedDatawithParameter in interface PriceIndexValuespublic SimplePriceIndexValues withPerturbation(ParameterPerturbation perturbation)
withPerturbation in interface ParameterizedDatawithPerturbation in interface PriceIndexValuespublic double value(PriceIndexObservation observation)
PriceIndexValuesThe rate of the Price index, such as 'US-CPI-U', varies over time. This method obtains the actual or estimated rate for the month.
This retrieves the actual rate if the fixing month is before the valuation month, or the estimated rate if the fixing month is after the valuation month. If the month equals the valuation month, then the best available value is returned.
value in interface PriceIndexValuesobservation - the rate observation, including the fixing monthpublic PointSensitivityBuilder valuePointSensitivity(PriceIndexObservation observation)
PriceIndexValues
This returns a sensitivity instance referring to the points that were queried in the market data.
If a time-series was used, then there is no sensitivity.
The sensitivity refers to the result of PriceIndexValues.value(PriceIndexObservation).
valuePointSensitivity in interface PriceIndexValuesobservation - the rate observation, including the fixing monthpublic CurrencyParameterSensitivities parameterSensitivity(InflationRateSensitivity pointSensitivity)
PriceIndexValuesThis is used to convert a single point sensitivity to parameter sensitivity. The calculation typically involves multiplying the point and unit sensitivities.
parameterSensitivity in interface PriceIndexValuespointSensitivity - the point sensitivity to convertpublic CurrencyParameterSensitivities createParameterSensitivity(Currency currency, DoubleArray sensitivities)
PriceIndexValues
In most cases, PriceIndexValues.parameterSensitivity(InflationRateSensitivity) should be used and manipulated.
However, it can be useful to create parameter sensitivity from pre-computed sensitivity values.
There will typically be one CurrencyParameterSensitivity for each underlying data
structure, such as a curve. For example, if the values are based on a single forward
curve, then there will be one CurrencyParameterSensitivity in the result.
createParameterSensitivity in interface PriceIndexValuescurrency - the currencysensitivities - the sensitivity values, which must match the parameter countpublic SimplePriceIndexValues withCurve(Curve curve)
curve - the new curvepublic static SimplePriceIndexValues.Meta meta()
SimplePriceIndexValues.public SimplePriceIndexValues.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic PriceIndex getIndex()
getIndex in interface PriceIndexValuespublic LocalDate getValuationDate()
getValuationDate in interface MarketDataViewpublic Curve getCurve()
public LocalDateDoubleTimeSeries getFixings()
Only one value is stored per month. The value is stored in the time-series on the last date of each month (which may be a non-working day).
getFixings in interface PriceIndexValuesCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.