Class SimpleIborIndexRates

• java.lang.Object
• com.opengamma.strata.pricer.rate.SimpleIborIndexRates
• All Implemented Interfaces:
MarketDataView, ParameterizedData, IborIndexRates, java.io.Serializable, Bean, ImmutableBean

public final class SimpleIborIndexRates
extends java.lang.Object
implements IborIndexRates, ImmutableBean, java.io.Serializable
An Ibor index curve providing rates directly from a forward rates curve.

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 fixing and direct forward rates.

Serialized Form
• Nested Class Summary

Nested Classes
Modifier and Type Class Description
static class  SimpleIborIndexRates.Meta
The meta-bean for SimpleIborIndexRates.
• Method Summary

All Methods
Modifier and Type Method Description
CurrencyParameterSensitivities createParameterSensitivity​(Currency currency, DoubleArray sensitivities)
Creates the parameter sensitivity when the sensitivity values are known.
boolean equals​(java.lang.Object obj)
<T> java.util.Optional<T> findData​(MarketDataName<T> name)
Finds the market data with the specified name.
Curve getCurve()
Gets the underlying forward curve.
LocalDateDoubleTimeSeries getFixings()
Gets the time-series of fixings, defaulted to an empty time-series.
IborIndex getIndex()
Gets the index that the rates are for.
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.
java.time.LocalDate getValuationDate()
Gets the valuation date.
int hashCode()
static SimpleIborIndexRates.Meta meta()
The meta-bean for SimpleIborIndexRates.
SimpleIborIndexRates.Meta metaBean()
static SimpleIborIndexRates of​(IborIndex index, java.time.LocalDate valuationDate, Curve curve)
Obtains an instance from a curve, with an empty time-series of fixings.
static SimpleIborIndexRates of​(IborIndex index, java.time.LocalDate valuationDate, Curve curve, LocalDateDoubleTimeSeries fixings)
Obtains an instance from a curve and time-series of fixing.
CurrencyParameterSensitivities parameterSensitivity​(IborRateSensitivity pointSensitivity)
Calculates the parameter sensitivity from the point sensitivity.
double rate​(IborIndexObservation observation)
Gets the historic or forward rate at the specified fixing date.
double rateIgnoringFixings​(IborIndexObservation observation)
Ignores the time-series of fixings to get the forward rate at the specified fixing date, used in rare and special cases.
PointSensitivityBuilder rateIgnoringFixingsPointSensitivity​(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.
PointSensitivityBuilder ratePointSensitivity​(IborIndexObservation observation)
Calculates the point sensitivity of the historic or forward rate at the specified fixing date.
java.lang.String toString()
SimpleIborIndexRates withCurve​(Curve curve)
Returns a new instance with a different curve.
SimpleIborIndexRates withParameter​(int parameterIndex, double newValue)
Returns a copy of the data with the value at the specified index altered.
SimpleIborIndexRates withPerturbation​(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 org.joda.beans.Bean

property, propertyNames
• Methods inherited from interface com.opengamma.strata.pricer.rate.IborIndexRates

explainRate
• Method Detail

• of

public static SimpleIborIndexRates of​(IborIndex index,
java.time.LocalDate valuationDate,
Curve curve)
Obtains an instance from a curve, with an empty time-series of fixings.

The curve is specified by an instance of Curve, such as InterpolatedNodalCurve. The curve must have x-values of year fractions with the day count specified. The y-values must be forward rates. A suitable metadata instance for the curve can be created by Curves.forwardRates(String, DayCount). In the curve the Ibor rates are indexed by the maturity date.

Parameters:
index - the index
valuationDate - the valuation date for which the curve is valid
curve - the curve of forward rates
Returns:
the rates view
• of

public static SimpleIborIndexRates of​(IborIndex index,
java.time.LocalDate valuationDate,
Curve curve,
LocalDateDoubleTimeSeries fixings)
Obtains an instance from a curve and time-series of fixing.

The curve is specified by an instance of Curve, such as InterpolatedNodalCurve. The curve must have x-values of year fractions with the day count specified. The y-values must be forward rates. In the curve the Ibor rates are indexed by the maturity date.

Parameters:
index - the index
valuationDate - the valuation date for which the curve is valid
curve - the curve of forward rates
fixings - the time-series of fixings
Returns:
the rates view
• findData

public <T> java.util.Optional<T> findData​(MarketDataName<T> name)
Description copied from interface: MarketDataView
Finds 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:
findData in interface MarketDataView
Type Parameters:
T - the type of the market data value
Parameters:
name - the name to find
Returns:
• getParameterCount

public int getParameterCount()
Description copied from interface: ParameterizedData
Gets 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:
getParameterCount in interface ParameterizedData
Returns:
the number of parameters
• getParameter

public double getParameter​(int parameterIndex)
Description copied from interface: ParameterizedData
Gets the value of the parameter at the specified index.
Specified by:
getParameter in interface ParameterizedData
Parameters:
parameterIndex - the zero-based index of the parameter to get
Returns:
the value of the parameter

public ParameterMetadata getParameterMetadata​(int parameterIndex)
Description copied from interface: ParameterizedData
Gets the metadata of the parameter at the specified index.

If there is no specific parameter metadata, an empty instance will be returned.

Specified by:
getParameterMetadata in interface ParameterizedData
Parameters:
parameterIndex - the zero-based index of the parameter to get
Returns:
• withParameter

public SimpleIborIndexRates withParameter​(int parameterIndex,
double newValue)
Description copied from interface: ParameterizedData
Returns 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:
withParameter in interface IborIndexRates
Specified by:
withParameter in interface ParameterizedData
Parameters:
parameterIndex - the zero-based index of the parameter to get
newValue - the new value for the specified parameter
Returns:
a parameterized data instance based on this with the specified parameter altered
• withPerturbation

public SimpleIborIndexRates withPerturbation​(ParameterPerturbation perturbation)
Description copied from interface: ParameterizedData
Returns 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:
withPerturbation in interface IborIndexRates
Specified by:
withPerturbation in interface ParameterizedData
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: IborIndexRates
Gets 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:
rate in interface IborIndexRates
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: IborIndexRates
Ignores 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 use rate(IborIndexObservation).

An instance of IborIndexRates is typically based on a forward curve and a historic time-series. The rate(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:
rateIgnoringFixings in interface IborIndexRates
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: IborIndexRates
Calculates 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:
ratePointSensitivity in interface IborIndexRates
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: IborIndexRates
Ignores 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 use ratePointSensitivity(IborIndexObservation).

An instance of IborIndexRates is typically based on a forward curve and a historic time-series. The ratePointSensitivity(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:
rateIgnoringFixingsPointSensitivity in interface IborIndexRates
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: IborIndexRates
Calculates 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:
parameterSensitivity in interface IborIndexRates
Parameters:
pointSensitivity - the point sensitivity to convert
Returns:
the parameter sensitivity
• createParameterSensitivity

public CurrencyParameterSensitivities createParameterSensitivity​(Currency currency,
DoubleArray sensitivities)
Description copied from interface: IborIndexRates
Creates 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 CurrencyParameterSensitivity for each underlying data structure, such as a curve. For example, if the rates are based on a single forward curve, then there will be one CurrencyParameterSensitivity in the result.

Specified by:
createParameterSensitivity in interface IborIndexRates
Parameters:
currency - the currency
sensitivities - the sensitivity values, which must match the parameter count
Returns:
the parameter sensitivity
• withCurve

public SimpleIborIndexRates withCurve​(Curve curve)
Returns a new instance with a different curve.
Parameters:
curve - the new curve
Returns:
the new instance
• meta

public static SimpleIborIndexRates.Meta meta()
The meta-bean for SimpleIborIndexRates.
Returns:
the meta-bean, not null
• metaBean

public SimpleIborIndexRates.Meta metaBean()
Specified by:
metaBean in interface Bean
• getIndex

public IborIndex getIndex()
Gets the index that the rates are for.
Specified by:
getIndex in interface IborIndexRates
Returns:
the value of the property, not null
• getValuationDate

public java.time.LocalDate getValuationDate()
Gets the valuation date.
Specified by:
getValuationDate in interface MarketDataView
Returns:
the value of the property, not null
• getCurve

public Curve getCurve()
Gets the underlying forward 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:
getFixings in interface IborIndexRates
Returns:
the value of the property, not null
• equals

public boolean equals​(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
• hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
• toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object