public final class DiscountOvernightIndexRates extends Object implements OvernightIndexRates, org.joda.beans.ImmutableBean, Serializable
This provides historic and forward rates for a single OvernightIndex
, such as 'EUR-EONIA'.
This implementation is based on an underlying curve that is stored with maturities and zero-coupon continuously-compounded rates.
Modifier and Type | Class and Description |
---|---|
static class |
DiscountOvernightIndexRates.Meta
The meta-bean for
DiscountOvernightIndexRates . |
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) |
DiscountFactors |
getDiscountFactors()
Gets the underlying discount factor curve.
|
LocalDateDoubleTimeSeries |
getFixings()
Gets the time-series of fixings, defaulted to an empty time-series.
|
OvernightIndex |
getIndex()
Gets the index that the rates are for.
|
double |
getParameter(int parameterIndex) |
int |
getParameterCount() |
ParameterMetadata |
getParameterMetadata(int parameterIndex) |
LocalDate |
getValuationDate() |
int |
hashCode() |
static DiscountOvernightIndexRates.Meta |
meta()
The meta-bean for
DiscountOvernightIndexRates . |
DiscountOvernightIndexRates.Meta |
metaBean() |
static DiscountOvernightIndexRates |
of(OvernightIndex index,
DiscountFactors discountFactors)
Obtains an instance based on discount factors with no historic fixings.
|
static DiscountOvernightIndexRates |
of(OvernightIndex index,
DiscountFactors discountFactors,
LocalDateDoubleTimeSeries fixings)
Obtains an instance based on discount factors and historic fixings.
|
CurrencyParameterSensitivities |
parameterSensitivity(OvernightRateSensitivity pointSensitivity)
Calculates the parameter sensitivity from the point sensitivity.
|
double |
periodRate(OvernightIndexObservation startDateObservation,
LocalDate endDate)
Gets the historic or forward rate at the specified fixing period.
|
PointSensitivityBuilder |
periodRatePointSensitivity(OvernightIndexObservation startDateObservation,
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 time-series of fixings to get the forward rate at the specified
fixing date, used in rare and special cases.
|
PointSensitivityBuilder |
rateIgnoringFixingsPointSensitivity(OvernightIndexObservation 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(OvernightIndexObservation observation)
Calculates the point sensitivity of the historic or forward rate at the specified fixing date.
|
String |
toString() |
DiscountOvernightIndexRates |
withDiscountFactors(DiscountFactors factors)
Returns a new instance with different discount factors.
|
DiscountOvernightIndexRates |
withParameter(int parameterIndex,
double newValue) |
DiscountOvernightIndexRates |
withPerturbation(ParameterPerturbation perturbation) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
of, of
public static DiscountOvernightIndexRates of(OvernightIndex index, DiscountFactors discountFactors)
The forward curve is specified by an instance of DiscountFactors
.
index
- the Overnight indexdiscountFactors
- the underlying discount factor forward curvepublic static DiscountOvernightIndexRates of(OvernightIndex index, DiscountFactors discountFactors, LocalDateDoubleTimeSeries fixings)
The forward curve is specified by an instance of DiscountFactors
.
index
- the Overnight indexdiscountFactors
- the underlying discount factor forward curvefixings
- the time-series of fixingspublic LocalDate getValuationDate()
getValuationDate
in interface MarketDataView
public <T> Optional<T> findData(MarketDataName<T> name)
findData
in interface MarketDataView
public int getParameterCount()
getParameterCount
in interface ParameterizedData
public double getParameter(int parameterIndex)
getParameter
in interface ParameterizedData
public ParameterMetadata getParameterMetadata(int parameterIndex)
getParameterMetadata
in interface ParameterizedData
public OptionalInt findParameterIndex(ParameterMetadata metadata)
findParameterIndex
in interface ParameterizedData
public DiscountOvernightIndexRates withParameter(int parameterIndex, double newValue)
withParameter
in interface ParameterizedData
withParameter
in interface OvernightIndexRates
public DiscountOvernightIndexRates withPerturbation(ParameterPerturbation perturbation)
withPerturbation
in interface ParameterizedData
withPerturbation
in interface OvernightIndexRates
public double rate(OvernightIndexObservation observation)
OvernightIndexRates
The rate of the Overnight index, such as 'EUR-EONIA', 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.
rate
in interface OvernightIndexRates
observation
- the rate observation, including the fixing datepublic double rateIgnoringFixings(OvernightIndexObservation observation)
OvernightIndexRates
rate(OvernightIndexObservation)
.
An instance of OvernightIndexRates
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.
rateIgnoringFixings
in interface OvernightIndexRates
observation
- the rate observation, including the fixing datepublic PointSensitivityBuilder ratePointSensitivity(OvernightIndexObservation observation)
OvernightIndexRates
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.
Otherwise, the sensitivity has the value 1.
The sensitivity refers to the result of OvernightIndexRates.rate(OvernightIndexObservation)
.
ratePointSensitivity
in interface OvernightIndexRates
observation
- the rate observation, including the fixing datepublic PointSensitivityBuilder rateIgnoringFixingsPointSensitivity(OvernightIndexObservation observation)
OvernightIndexRates
ratePointSensitivity(OvernightIndexObservation)
.
An instance of OvernightIndexRates
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.
rateIgnoringFixingsPointSensitivity
in interface OvernightIndexRates
observation
- the rate observation, including the fixing datepublic double periodRate(OvernightIndexObservation startDateObservation, LocalDate endDate)
OvernightIndexRates
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 speed-up 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
.
periodRate
in interface OvernightIndexRates
startDateObservation
- the rate observation for the start of the periodendDate
- the end or maturity date of the period on which the rate is computedpublic PointSensitivityBuilder periodRatePointSensitivity(OvernightIndexObservation startDateObservation, LocalDate endDate)
OvernightIndexRates
This returns a sensitivity instance referring to the points that were queried in the market data.
The sensitivity refers to the result of OvernightIndexRates.periodRate(OvernightIndexObservation, LocalDate)
.
periodRatePointSensitivity
in interface OvernightIndexRates
startDateObservation
- the rate observation for the start of the periodendDate
- the end or maturity date of the period on which the rate is computedpublic CurrencyParameterSensitivities parameterSensitivity(OvernightRateSensitivity pointSensitivity)
OvernightIndexRates
This is used to convert a single point sensitivity to parameter sensitivity. The calculation typically involves multiplying the point and unit sensitivities.
parameterSensitivity
in interface OvernightIndexRates
pointSensitivity
- the point sensitivity to convertpublic CurrencyParameterSensitivities createParameterSensitivity(Currency currency, DoubleArray sensitivities)
OvernightIndexRates
In most cases, OvernightIndexRates.parameterSensitivity(OvernightRateSensitivity)
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.
createParameterSensitivity
in interface OvernightIndexRates
currency
- the currencysensitivities
- the sensitivity values, which must match the parameter countpublic DiscountOvernightIndexRates withDiscountFactors(DiscountFactors factors)
factors
- the new discount factorspublic static DiscountOvernightIndexRates.Meta meta()
DiscountOvernightIndexRates
.public DiscountOvernightIndexRates.Meta metaBean()
metaBean
in interface org.joda.beans.Bean
public OvernightIndex getIndex()
getIndex
in interface OvernightIndexRates
public DiscountFactors getDiscountFactors()
public LocalDateDoubleTimeSeries getFixings()
getFixings
in interface OvernightIndexRates
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.