public final class ZeroRatePeriodicDiscountFactors 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 periodically-compounded rates.
| Modifier and Type | Class and Description |
|---|---|
static class |
ZeroRatePeriodicDiscountFactors.Meta
The meta-bean for
ZeroRatePeriodicDiscountFactors. |
| 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 relativeYearFraction)
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 ZeroRatePeriodicDiscountFactors.Meta |
meta()
The meta-bean for
ZeroRatePeriodicDiscountFactors. |
ZeroRatePeriodicDiscountFactors.Meta |
metaBean() |
static ZeroRatePeriodicDiscountFactors |
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() |
ZeroRatePeriodicDiscountFactors |
withCurve(Curve curve)
Returns a new instance with a different curve.
|
ZeroRatePeriodicDiscountFactors |
withParameter(int parameterIndex,
double newValue) |
ZeroRatePeriodicDiscountFactors |
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.
|
ZeroRateSensitivity |
zeroRatePointSensitivityWithSpread(double yearFraction,
Currency sensitivityCurrency,
double zSpread,
CompoundedRateType compoundedRateType,
int periodPerYear)
Calculates the zero rate point sensitivity with z-spread 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, zeroRatePointSensitivityWithSpreadpublic static ZeroRatePeriodicDiscountFactors 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.
The day count and compounding periods per year must be present in the metadata.
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 ZeroRatePeriodicDiscountFactors withParameter(int parameterIndex, double newValue)
withParameter in interface ParameterizedDatawithParameter in interface DiscountFactorspublic ZeroRatePeriodicDiscountFactors 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 relativeYearFraction)
DiscountFactors
The year fraction must be based on #relativeYearFraction(LocalDate).
discountFactor in interface DiscountFactorsrelativeYearFraction - 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 ZeroRateSensitivity zeroRatePointSensitivityWithSpread(double yearFraction, Currency sensitivityCurrency, double zSpread, CompoundedRateType compoundedRateType, int periodPerYear)
DiscountFactors
This returns a sensitivity instance referring to the zero rate sensitivity of the
points that were queried in the market data.
The sensitivity refers to the result of DiscountFactors.discountFactorWithSpread(LocalDate, double, CompoundedRateType, int).
The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the discounting curve.
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).
zeroRatePointSensitivityWithSpread in interface DiscountFactorsyearFraction - the year fractionsensitivityCurrency - the currency of the sensitivityzSpread - the z-spreadcompoundedRateType - the compounded rate typeperiodPerYear - the number of periods per yearpublic 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 ZeroRatePeriodicDiscountFactors withCurve(Curve curve)
curve - the new curvepublic static ZeroRatePeriodicDiscountFactors.Meta meta()
ZeroRatePeriodicDiscountFactors.public ZeroRatePeriodicDiscountFactors.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.