public final class ZeroRateDiscountFactors extends Object implements DiscountFactors, org.joda.beans.ImmutableBean, Serializable
This provides discount factors for a single currency.
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 |
ZeroRateDiscountFactors.Meta
The meta-bean for
ZeroRateDiscountFactors. |
| Modifier and Type | Method and Description |
|---|---|
CurrencyParameterSensitivities |
createParameterSensitivity(Currency currency,
DoubleArray sensitivities)
Creates the parameter sensitivity when the sensitivity values are known.
|
double |
discountFactor(double yearFraction)
Gets the discount factor for specified year fraction.
|
double |
discountFactorTimeDerivative(double yearFraction)
Returns the discount factor derivative with respect to the year fraction or time.
|
boolean |
equals(Object obj) |
<T> Optional<T> |
findData(MarketDataName<T> name) |
OptionalInt |
findParameterIndex(ParameterMetadata metadata) |
Currency |
getCurrency()
Gets the currency that the discount factors are for.
|
Curve |
getCurve()
Gets the underlying curve.
|
double |
getParameter(int parameterIndex) |
int |
getParameterCount() |
ParameterMetadata |
getParameterMetadata(int parameterIndex) |
LocalDate |
getValuationDate()
Gets the valuation date.
|
int |
hashCode() |
static ZeroRateDiscountFactors.Meta |
meta()
The meta-bean for
ZeroRateDiscountFactors. |
ZeroRateDiscountFactors.Meta |
metaBean() |
static ZeroRateDiscountFactors |
of(Currency currency,
LocalDate valuationDate,
Curve underlyingCurve)
Obtains an instance based on a zero-rates curve.
|
CurrencyParameterSensitivities |
parameterSensitivity(ZeroRateSensitivity pointSens)
Calculates the parameter sensitivity from the point sensitivity.
|
double |
relativeYearFraction(LocalDate date)
Calculates the relative time between the valuation date and the specified date.
|
String |
toString() |
ZeroRateDiscountFactors |
withCurve(Curve curve)
Returns a new instance with a different curve.
|
ZeroRateDiscountFactors |
withParameter(int parameterIndex,
double newValue) |
ZeroRateDiscountFactors |
withPerturbation(ParameterPerturbation perturbation) |
double |
zeroRate(double yearFraction)
Gets the continuously compounded zero rate for specified year fraction.
|
ZeroRateSensitivity |
zeroRatePointSensitivity(double yearFraction,
Currency sensitivityCurrency)
Calculates the zero rate point sensitivity at the specified year fraction specifying the currency of the sensitivity.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitdiscountFactor, discountFactorWithSpread, discountFactorWithSpread, zeroRate, zeroRatePointSensitivity, zeroRatePointSensitivity, zeroRatePointSensitivity, zeroRatePointSensitivityWithSpread, zeroRatePointSensitivityWithSpread, zeroRatePointSensitivityWithSpread, zeroRatePointSensitivityWithSpreadpublic static ZeroRateDiscountFactors of(Currency currency, LocalDate valuationDate, Curve underlyingCurve)
The curve is specified by an instance of Curve, such as InterpolatedNodalCurve.
The curve must contain year fractions
against zero rates, and the day count must be present.
A suitable metadata instance for the curve can be created by Curves.zeroRates(String, DayCount).
of in interface DiscountFactorscurrency - the currencyvaluationDate - the valuation date for which the curve is validunderlyingCurve - the underlying curvepublic <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 ZeroRateDiscountFactors withParameter(int parameterIndex, double newValue)
withParameter in interface ParameterizedDatawithParameter in interface DiscountFactorspublic ZeroRateDiscountFactors withPerturbation(ParameterPerturbation perturbation)
withPerturbation in interface ParameterizedDatawithPerturbation in interface DiscountFactorspublic double relativeYearFraction(LocalDate date)
DiscountFactors
The double value returned from this method is used as the input to other methods.
It is typically calculated from a DayCount.
relativeYearFraction in interface DiscountFactorsdate - the datepublic double discountFactor(double yearFraction)
DiscountFactors
The year fraction must be based on #relativeYearFraction(LocalDate).
discountFactor in interface DiscountFactorsyearFraction - the year fractionpublic double discountFactorTimeDerivative(double yearFraction)
DiscountFactors
The year fraction must be based on #relativeYearFraction(LocalDate).
discountFactorTimeDerivative in interface DiscountFactorsyearFraction - the year fractionpublic double zeroRate(double yearFraction)
DiscountFactors
The year fraction must be based on #relativeYearFraction(LocalDate).
zeroRate in interface DiscountFactorsyearFraction - the year fractionpublic ZeroRateSensitivity zeroRatePointSensitivity(double yearFraction, Currency sensitivityCurrency)
DiscountFactors
This returns a sensitivity instance referring to the zero rate sensitivity of the
points that were queried in the market data.
The sensitivity typically has the value (-discountFactor * yearFraction).
The sensitivity refers to the result of DiscountFactors.discountFactor(LocalDate).
This method allows the currency of the sensitivity to differ from the currency of the market data.
The year fraction must be based on #relativeYearFraction(LocalDate).
zeroRatePointSensitivity in interface DiscountFactorsyearFraction - the year fractionsensitivityCurrency - the currency of the sensitivitypublic CurrencyParameterSensitivities parameterSensitivity(ZeroRateSensitivity pointSens)
DiscountFactorsThis is used to convert a single point sensitivity to parameter sensitivity. The calculation typically involves multiplying the point and unit sensitivities.
parameterSensitivity in interface DiscountFactorspointSens - the point sensitivity to convertpublic CurrencyParameterSensitivities createParameterSensitivity(Currency currency, DoubleArray sensitivities)
DiscountFactors
In most cases, DiscountFactors.parameterSensitivity(ZeroRateSensitivity) 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 discount factors are based on a single discount
curve, then there will be one CurrencyParameterSensitivity in the result.
createParameterSensitivity in interface DiscountFactorscurrency - the currencysensitivities - the sensitivity values, which must match the parameter countpublic ZeroRateDiscountFactors withCurve(Curve curve)
curve - the new curvepublic static ZeroRateDiscountFactors.Meta meta()
ZeroRateDiscountFactors.public ZeroRateDiscountFactors.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic Currency getCurrency()
getCurrency in interface DiscountFactorspublic LocalDate getValuationDate()
getValuationDate in interface MarketDataViewpublic Curve getCurve()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.