Class DiscountIborIndexRates
- java.lang.Object
-
- com.opengamma.strata.pricer.rate.DiscountIborIndexRates
-
- All Implemented Interfaces:
MarketDataView,ParameterizedData,IborIndexRates,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class DiscountIborIndexRates extends Object implements IborIndexRates, org.joda.beans.ImmutableBean, Serializable
An Ibor index curve providing rates from discount factors.This provides historic and forward rates for a single
IborIndex, such as 'GBP-LIBOR-3M'.This implementation is based on an underlying curve that is stored with maturities and zero-coupon continuously-compounded rates.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDiscountIborIndexRates.MetaThe meta-bean forDiscountIborIndexRates.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CurrencyParameterSensitivitiescreateParameterSensitivity(Currency currency, DoubleArray sensitivities)Creates the parameter sensitivity when the sensitivity values are known.booleanequals(Object obj)<T> Optional<T>findData(MarketDataName<T> name)Finds the market data with the specified name.OptionalIntfindParameterIndex(ParameterMetadata metadata)Finds the parameter index of the specified metadata.DiscountFactorsgetDiscountFactors()Gets the underlying discount factor curve.LocalDateDoubleTimeSeriesgetFixings()Gets the time-series of fixings, defaulted to an empty time-series.IborIndexgetIndex()Gets the index that the rates are for.doublegetParameter(int parameterIndex)Gets the value of the parameter at the specified index.intgetParameterCount()Gets the number of parameters.ParameterMetadatagetParameterMetadata(int parameterIndex)Gets the metadata of the parameter at the specified index.LocalDategetValuationDate()Gets the valuation date.inthashCode()static DiscountIborIndexRates.Metameta()The meta-bean forDiscountIborIndexRates.DiscountIborIndexRates.MetametaBean()static DiscountIborIndexRatesof(IborIndex index, DiscountFactors discountFactors)Obtains an instance based on discount factors with no historic fixings.static DiscountIborIndexRatesof(IborIndex index, DiscountFactors discountFactors, LocalDateDoubleTimeSeries fixings)Obtains an instance based on discount factors and historic fixings.CurrencyParameterSensitivitiesparameterSensitivity(IborRateSensitivity pointSensitivity)Calculates the parameter sensitivity from the point sensitivity.doublerate(IborIndexObservation observation)Gets the historic or forward rate at the specified fixing date.doublerateIgnoringFixings(IborIndexObservation observation)Ignores the time-series of fixings to get the forward rate at the specified fixing date, used in rare and special cases.PointSensitivityBuilderrateIgnoringFixingsPointSensitivity(IborIndexObservation observation)Ignores the time-series of fixings to get the forward rate point sensitivity at the specified fixing date, used in rare and special cases.PointSensitivityBuilderratePointSensitivity(IborIndexObservation observation)Calculates the point sensitivity of the historic or forward rate at the specified fixing date.StringtoString()DiscountIborIndexRateswithDiscountFactors(DiscountFactors factors)Returns a new instance with different discount factors.DiscountIborIndexRateswithParameter(int parameterIndex, double newValue)Returns a copy of the data with the value at the specified index altered.DiscountIborIndexRateswithPerturbation(ParameterPerturbation perturbation)Returns a perturbed copy of the data.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.pricer.rate.IborIndexRates
explainRate
-
-
-
-
Method Detail
-
of
public static DiscountIborIndexRates of(IborIndex index, DiscountFactors discountFactors)
Obtains an instance based on discount factors with no historic fixings.The forward curve is specified by an instance of
DiscountFactors.- Parameters:
index- the Ibor indexdiscountFactors- the underlying discount factor forward curve- Returns:
- the rates instance
-
of
public static DiscountIborIndexRates of(IborIndex index, DiscountFactors discountFactors, LocalDateDoubleTimeSeries fixings)
Obtains an instance based on discount factors and historic fixings.The forward curve is specified by an instance of
DiscountFactors.- Parameters:
index- the Ibor indexdiscountFactors- the underlying discount factor forward curvefixings- the time-series of fixings- Returns:
- the rates instance
-
getValuationDate
public LocalDate getValuationDate()
Description copied from interface:MarketDataViewGets the valuation date.The raw data in this provider is calibrated for this date.
- Specified by:
getValuationDatein interfaceMarketDataView- Returns:
- the valuation date
-
findData
public <T> Optional<T> findData(MarketDataName<T> name)
Description copied from interface:MarketDataViewFinds the market data with the specified name.This is most commonly used to find an underlying curve or surface by name. If the market data cannot be found, empty is returned.
- Specified by:
findDatain interfaceMarketDataView- Type Parameters:
T- the type of the market data value- Parameters:
name- the name to find- Returns:
- the market data value, empty if not found
-
getParameterCount
public int getParameterCount()
Description copied from interface:ParameterizedDataGets the number of parameters.This returns the number of parameters, which can be used to create a loop to access the other methods on this interface.
- Specified by:
getParameterCountin interfaceParameterizedData- Returns:
- the number of parameters
-
getParameter
public double getParameter(int parameterIndex)
Description copied from interface:ParameterizedDataGets the value of the parameter at the specified index.- Specified by:
getParameterin interfaceParameterizedData- Parameters:
parameterIndex- the zero-based index of the parameter to get- Returns:
- the value of the parameter
-
getParameterMetadata
public ParameterMetadata getParameterMetadata(int parameterIndex)
Description copied from interface:ParameterizedDataGets the metadata of the parameter at the specified index.If there is no specific parameter metadata, an empty instance will be returned.
- Specified by:
getParameterMetadatain interfaceParameterizedData- Parameters:
parameterIndex- the zero-based index of the parameter to get- Returns:
- the metadata of the parameter
-
findParameterIndex
public OptionalInt findParameterIndex(ParameterMetadata metadata)
Description copied from interface:ParameterizedDataFinds the parameter index of the specified metadata.If the parameter metadata is not matched, an empty optional will be returned.
- Specified by:
findParameterIndexin interfaceParameterizedData- Parameters:
metadata- the parameter metadata to find the index of- Returns:
- the index of the parameter
-
withParameter
public DiscountIborIndexRates withParameter(int parameterIndex, double newValue)
Description copied from interface:ParameterizedDataReturns a copy of the data with the value at the specified index altered.This instance is immutable and unaffected by this method call.
- Specified by:
withParameterin interfaceIborIndexRates- Specified by:
withParameterin interfaceParameterizedData- Parameters:
parameterIndex- the zero-based index of the parameter to getnewValue- the new value for the specified parameter- Returns:
- a parameterized data instance based on this with the specified parameter altered
-
withPerturbation
public DiscountIborIndexRates withPerturbation(ParameterPerturbation perturbation)
Description copied from interface:ParameterizedDataReturns a perturbed copy of the data.The perturbation instance will be invoked once for each parameter in this instance, returning the perturbed value for that parameter. The result of this method is a new instance that is based on those perturbed values.
This instance is immutable and unaffected by this method call.
- Specified by:
withPerturbationin interfaceIborIndexRates- Specified by:
withPerturbationin interfaceParameterizedData- Parameters:
perturbation- the perturbation to apply- Returns:
- a parameterized data instance based on this with the specified perturbation applied
-
rate
public double rate(IborIndexObservation observation)
Description copied from interface:IborIndexRatesGets the historic or forward rate at the specified fixing date.The rate of the Ibor index, such as 'GBP-LIBOR-3M', varies over time. This method obtains the actual or estimated rate for the fixing date.
This retrieves the actual rate if the fixing date is before the valuation date, or the estimated rate if the fixing date is after the valuation date. If the fixing date equals the valuation date, then the best available rate is returned.
- Specified by:
ratein interfaceIborIndexRates- Parameters:
observation- the rate observation, including the fixing date- Returns:
- the rate of the index, either historic or forward
-
rateIgnoringFixings
public double rateIgnoringFixings(IborIndexObservation observation)
Description copied from interface:IborIndexRatesIgnores the time-series of fixings to get the forward rate at the specified fixing date, used in rare and special cases. In most cases callers should userate(IborIndexObservation).An instance of
IborIndexRatesis typically based on a forward curve and a historic time-series. Therate(LocalDate)method uses either the curve or time-series, depending on whether the fixing date is before or after the valuation date. This method only queries the forward curve, totally ignoring the time-series, which is needed for rare and special cases only.- Specified by:
rateIgnoringFixingsin interfaceIborIndexRates- Parameters:
observation- the rate observation, including the fixing date- Returns:
- the rate of the index ignoring the time-series of fixings
-
ratePointSensitivity
public PointSensitivityBuilder ratePointSensitivity(IborIndexObservation observation)
Description copied from interface:IborIndexRatesCalculates the point sensitivity of the historic or forward rate at the specified fixing date.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
rate(IborIndexObservation).- Specified by:
ratePointSensitivityin interfaceIborIndexRates- Parameters:
observation- the rate observation, including the fixing date- Returns:
- the point sensitivity of the rate
-
rateIgnoringFixingsPointSensitivity
public PointSensitivityBuilder rateIgnoringFixingsPointSensitivity(IborIndexObservation observation)
Description copied from interface:IborIndexRatesIgnores the time-series of fixings to get the forward rate point sensitivity at the specified fixing date, used in rare and special cases. In most cases callers should useratePointSensitivity(IborIndexObservation).An instance of
IborIndexRatesis typically based on a forward curve and a historic time-series. TheratePointSensitivity(LocalDate)method uses either the curve or time-series, depending on whether the fixing date is before or after the valuation date. This method only queries the forward curve, totally ignoring the time-series, which is needed for rare and special cases only.- Specified by:
rateIgnoringFixingsPointSensitivityin interfaceIborIndexRates- Parameters:
observation- the rate observation, including the fixing date- Returns:
- the point sensitivity of the rate ignoring the time-series of fixings
-
parameterSensitivity
public CurrencyParameterSensitivities parameterSensitivity(IborRateSensitivity pointSensitivity)
Description copied from interface:IborIndexRatesCalculates the parameter sensitivity from the point sensitivity.This is used to convert a single point sensitivity to parameter sensitivity. The calculation typically involves multiplying the point and unit sensitivities.
- Specified by:
parameterSensitivityin interfaceIborIndexRates- Parameters:
pointSensitivity- the point sensitivity to convert- Returns:
- the parameter sensitivity
-
createParameterSensitivity
public CurrencyParameterSensitivities createParameterSensitivity(Currency currency, DoubleArray sensitivities)
Description copied from interface:IborIndexRatesCreates the parameter sensitivity when the sensitivity values are known.In most cases,
IborIndexRates.parameterSensitivity(IborRateSensitivity)should be used and manipulated. However, it can be useful to create parameter sensitivity from pre-computed sensitivity values.There will typically be one
CurrencyParameterSensitivityfor each underlying data structure, such as a curve. For example, if the rates are based on a single forward curve, then there will be oneCurrencyParameterSensitivityin the result.- Specified by:
createParameterSensitivityin interfaceIborIndexRates- Parameters:
currency- the currencysensitivities- the sensitivity values, which must match the parameter count- Returns:
- the parameter sensitivity
-
withDiscountFactors
public DiscountIborIndexRates withDiscountFactors(DiscountFactors factors)
Returns a new instance with different discount factors.- Parameters:
factors- the new discount factors- Returns:
- the new instance
-
meta
public static DiscountIborIndexRates.Meta meta()
The meta-bean forDiscountIborIndexRates.- Returns:
- the meta-bean, not null
-
metaBean
public DiscountIborIndexRates.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getIndex
public IborIndex getIndex()
Gets the index that the rates are for.- Specified by:
getIndexin interfaceIborIndexRates- Returns:
- the value of the property, not null
-
getDiscountFactors
public DiscountFactors getDiscountFactors()
Gets the underlying discount factor curve.- Returns:
- the value of the property, not null
-
getFixings
public LocalDateDoubleTimeSeries getFixings()
Gets the time-series of fixings, defaulted to an empty time-series. This includes the known historical fixings and may be empty.- Specified by:
getFixingsin interfaceIborIndexRates- Returns:
- the value of the property, not null
-
-