Interface OvernightIndexRates

 All Superinterfaces:
MarketDataView
,ParameterizedData
 All Known Implementing Classes:
DiscountOvernightIndexRates
,HistoricOvernightIndexRates
public interface OvernightIndexRates extends MarketDataView, ParameterizedData
Provides access to rates for an Overnight index.This provides historic and forward rates for a single
OvernightIndex
, such as 'EUREONIA'.


Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description CurrencyParameterSensitivities
createParameterSensitivity(Currency currency, DoubleArray sensitivities)
Creates the parameter sensitivity when the sensitivity values are known.LocalDateDoubleTimeSeries
getFixings()
Gets the timeseries of fixings for the index.OvernightIndex
getIndex()
Gets the Overnight index.static OvernightIndexRates
of(OvernightIndex index, java.time.LocalDate valuationDate, Curve forwardCurve)
Obtains an instance from a forward curve, with an empty timeseries of fixings.static OvernightIndexRates
of(OvernightIndex index, java.time.LocalDate valuationDate, Curve forwardCurve, LocalDateDoubleTimeSeries fixings)
Obtains an instance from a curve and timeseries of fixings.CurrencyParameterSensitivities
parameterSensitivity(OvernightRateSensitivity pointSensitivity)
Calculates the parameter sensitivity from the point sensitivity.double
periodRate(OvernightIndexObservation startDateObservation, java.time.LocalDate endDate)
Gets the historic or forward rate at the specified fixing period.PointSensitivityBuilder
periodRatePointSensitivity(OvernightIndexObservation startDateObservation, java.time.LocalDate endDate)
Calculates the point sensitivity of the historic or forward rate at the specified fixing period.double
rate(OvernightIndexObservation observation)
Gets the historic or forward rate at the specified fixing date.double
rateIgnoringFixings(OvernightIndexObservation observation)
Ignores the timeseries of fixings to get the forward rate at the specified fixing date, used in rare and special cases.PointSensitivityBuilder
rateIgnoringFixingsPointSensitivity(OvernightIndexObservation observation)
Ignores the timeseries of fixings to get the forward rate point sensitivity at the specified fixing date, used in rare and special cases.PointSensitivityBuilder
ratePointSensitivity(OvernightIndexObservation observation)
Calculates the point sensitivity of the historic or forward rate at the specified fixing date.OvernightIndexRates
withParameter(int parameterIndex, double newValue)
Returns a copy of the data with the value at the specified index altered.OvernightIndexRates
withPerturbation(ParameterPerturbation perturbation)
Returns a perturbed copy of the data.
Methods inherited from interface com.opengamma.strata.market.MarketDataView
findData, getValuationDate

Methods inherited from interface com.opengamma.strata.market.param.ParameterizedData
getParameter, getParameterCount, getParameterMetadata




Method Detail

of
static OvernightIndexRates of(OvernightIndex index, java.time.LocalDate valuationDate, Curve forwardCurve)
Obtains an instance from a forward curve, with an empty timeseries of fixings.The curve is specified by an instance of
Curve
, such asInterpolatedNodalCurve
. The curve must have xvalues of year fractions with the day count specified. The yvalues must be zero rates or discount factors. Parameters:
index
 the indexvaluationDate
 the valuation date for which the curve is validforwardCurve
 the forward curve Returns:
 the rates view

of
static OvernightIndexRates of(OvernightIndex index, java.time.LocalDate valuationDate, Curve forwardCurve, LocalDateDoubleTimeSeries fixings)
Obtains an instance from a curve and timeseries of fixings.The curve is specified by an instance of
Curve
, such asInterpolatedNodalCurve
. The curve must have xvalues of year fractions with the day count specified. The yvalues must be zero rates or discount factors. Parameters:
index
 the indexvaluationDate
 the valuation date for which the curve is validforwardCurve
 the forward curvefixings
 the timeseries of fixings Returns:
 the rates view

getIndex
OvernightIndex getIndex()
Gets the Overnight index.The index that the rates are for.
 Returns:
 the Overnight index

getFixings
LocalDateDoubleTimeSeries getFixings()
Gets the timeseries of fixings for the index.The timeseries contains historic fixings of the index. It may be empty if the data is not available.
 Returns:
 the timeseries fixings

withParameter
OvernightIndexRates 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 interfaceParameterizedData
 Parameters:
parameterIndex
 the zerobased 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
OvernightIndexRates 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 interfaceParameterizedData
 Parameters:
perturbation
 the perturbation to apply Returns:
 a parameterized data instance based on this with the specified perturbation applied

rate
double rate(OvernightIndexObservation observation)
Gets the historic or forward rate at the specified fixing date.The rate of the Overnight index, such as 'EUREONIA', 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. The reference period for the underlying deposit is computed from the index conventions.
 Parameters:
observation
 the rate observation, including the fixing date Returns:
 the rate of the index, either historic or forward
 Throws:
java.lang.RuntimeException
 if the value cannot be obtained

rateIgnoringFixings
double rateIgnoringFixings(OvernightIndexObservation observation)
Ignores the timeseries of fixings to get the forward rate at the specified fixing date, used in rare and special cases. In most cases callers should userate(OvernightIndexObservation)
.An instance of
OvernightIndexRates
is typically based on a forward curve and a historic timeseries. Therate(LocalDate)
method uses either the curve or timeseries, depending on whether the fixing date is before or after the valuation date. This method only queries the forward curve, totally ignoring the timeseries, which is needed for rare and special cases only. Parameters:
observation
 the rate observation, including the fixing date Returns:
 the rate of the index ignoring the timeseries of fixings

ratePointSensitivity
PointSensitivityBuilder ratePointSensitivity(OvernightIndexObservation observation)
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 timeseries was used, then there is no sensitivity. Otherwise, the sensitivity has the value 1. The sensitivity refers to the result of
rate(OvernightIndexObservation)
. Parameters:
observation
 the rate observation, including the fixing date Returns:
 the point sensitivity of the rate
 Throws:
java.lang.RuntimeException
 if the result cannot be calculated

rateIgnoringFixingsPointSensitivity
PointSensitivityBuilder rateIgnoringFixingsPointSensitivity(OvernightIndexObservation observation)
Ignores the timeseries 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(OvernightIndexObservation)
.An instance of
OvernightIndexRates
is typically based on a forward curve and a historic timeseries. TheratePointSensitivity(LocalDate)
method uses either the curve or timeseries, depending on whether the fixing date is before or after the valuation date. This method only queries the forward curve, totally ignoring the timeseries, which is needed for rare and special cases only. Parameters:
observation
 the rate observation, including the fixing date Returns:
 the point sensitivity of the rate ignoring the timeseries of fixings

periodRate
double periodRate(OvernightIndexObservation startDateObservation, java.time.LocalDate endDate)
Gets the historic or forward rate at the specified fixing period.The start date should be on or after the valuation date. The end date should be after the start date.
This computes the forward rate in the simple simply compounded convention of the index between two given date. This is used mainly to speedup computation by computing the rate on a longer period instead of each individual overnight rate. When data related to the overnight index rate are stored based on the fixing date and not the start and end date of the period, the call may return an
IllegalArgumentException
. Parameters:
startDateObservation
 the rate observation for the start of the periodendDate
 the end or maturity date of the period on which the rate is computed Returns:
 the simply compounded rate associated to the period for the index
 Throws:
java.lang.RuntimeException
 if the value cannot be obtained

periodRatePointSensitivity
PointSensitivityBuilder periodRatePointSensitivity(OvernightIndexObservation startDateObservation, java.time.LocalDate endDate)
Calculates the point sensitivity of the historic or forward rate at the specified fixing period.This returns a sensitivity instance referring to the points that were queried in the market data. The sensitivity refers to the result of
periodRate(OvernightIndexObservation, LocalDate)
. Parameters:
startDateObservation
 the rate observation for the start of the periodendDate
 the end or maturity date of the period on which the rate is computed Returns:
 the point sensitivity of the rate
 Throws:
java.lang.RuntimeException
 if the result cannot be calculated

parameterSensitivity
CurrencyParameterSensitivities parameterSensitivity(OvernightRateSensitivity pointSensitivity)
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.
 Parameters:
pointSensitivity
 the point sensitivity to convert Returns:
 the parameter sensitivity
 Throws:
java.lang.RuntimeException
 if the result cannot be calculated

createParameterSensitivity
CurrencyParameterSensitivities createParameterSensitivity(Currency currency, DoubleArray sensitivities)
Creates the parameter sensitivity when the sensitivity values are known.In most cases,
parameterSensitivity(OvernightRateSensitivity)
should be used and manipulated. However, it can be useful to create parameter sensitivity from precomputed 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 oneCurrencyParameterSensitivity
in the result. Parameters:
currency
 the currencysensitivities
 the sensitivity values, which must match the parameter count Returns:
 the parameter sensitivity
 Throws:
java.lang.RuntimeException
 if the result cannot be calculated

