public interface CreditDiscountFactors extends MarketDataView, ParameterizedData
The discount factor represents the time value of money for the specified currency when comparing the valuation date to the specified date.
This is also used for representing survival probabilities of a legal entity for a single currency.
| 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.
|
default double |
discountFactor(LocalDate date)
Gets the discount factor for the specified date.
|
Currency |
getCurrency()
Gets the currency.
|
DayCount |
getDayCount()
Obtains day count convention.
|
DoubleArray |
getParameterKeys()
Obtains the parameter keys of the underlying curve.
|
default boolean |
isIsdaCompliant()
Checks if the instance is based on an ISDA compliant curve.
|
static CreditDiscountFactors |
of(Currency currency,
LocalDate valuationDate,
Curve curve)
Obtains an instance from a curve.
|
CurrencyParameterSensitivities |
parameterSensitivity(ZeroRateSensitivity pointSensitivity)
Calculates the parameter sensitivity from the point sensitivity.
|
double |
relativeYearFraction(LocalDate date)
Calculates the relative time between the valuation date and the specified date.
|
DiscountFactors |
toDiscountFactors()
Creates an instance of
DiscountFactors. |
CreditDiscountFactors |
withParameter(int parameterIndex,
double newValue) |
CreditDiscountFactors |
withPerturbation(ParameterPerturbation perturbation) |
double |
zeroRate(double yearFraction)
Gets the continuously compounded zero rate for specified year fraction.
|
default double |
zeroRate(LocalDate date)
Gets the continuously compounded zero rate for the specified date.
|
default ZeroRateSensitivity |
zeroRatePointSensitivity(double yearFraction)
Calculates the zero rate point sensitivity at the 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.
|
default ZeroRateSensitivity |
zeroRatePointSensitivity(LocalDate date)
Calculates the zero rate point sensitivity at the specified date.
|
default ZeroRateSensitivity |
zeroRatePointSensitivity(LocalDate date,
Currency sensitivityCurrency)
Calculates the zero rate point sensitivity at the specified date specifying the currency of the sensitivity.
|
findData, getValuationDatefindParameterIndex, getParameter, getParameterCount, getParameterMetadatastatic CreditDiscountFactors of(Currency currency, LocalDate valuationDate, Curve curve)
If the curve satisfies the conditions for ISDA compliant curve,
IsdaCompliantZeroRateDiscountFactors is always instantiated.
currency - the currencyvaluationDate - the valuation date for which the curve is validcurve - the underlying curveCurrency getCurrency()
The currency that discount factors are provided for.
DayCount getDayCount()
This is typically the day count convention of the underlying curve.
DiscountFactors toDiscountFactors()
DiscountFactors.DoubleArray getParameterKeys()
CreditDiscountFactors withParameter(int parameterIndex, double newValue)
withParameter in interface ParameterizedDataCreditDiscountFactors withPerturbation(ParameterPerturbation perturbation)
withPerturbation in interface ParameterizedDatadefault boolean isIsdaCompliant()
This returns 'false' by default, and should be overridden when needed.
double relativeYearFraction(LocalDate date)
The double value returned from this method is used as the input to other methods.
It is typically calculated from a DayCount.
date - the dateRuntimeException - if it is not possible to convert dates to relative timesdefault double discountFactor(LocalDate date)
The discount factor represents the time value of money for the specified currency when comparing the valuation date to the specified date.
If the valuation date is on the specified date, the discount factor is 1.
date - the date to discount toRuntimeException - if the value cannot be obtaineddouble discountFactor(double yearFraction)
The year fraction must be based on #relativeYearFraction(LocalDate).
yearFraction - the year fractionRuntimeException - if the value cannot be obtaineddefault double zeroRate(LocalDate date)
The continuously compounded zero rate is coherent to discountFactor(LocalDate) along with
year fraction which is computed internally in each implementation.
date - the date to discount toRuntimeException - if the value cannot be obtaineddouble zeroRate(double yearFraction)
The year fraction must be based on #relativeYearFraction(LocalDate).
yearFraction - the year fractionRuntimeException - if the value cannot be obtaineddefault ZeroRateSensitivity zeroRatePointSensitivity(LocalDate date)
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 discountFactor(LocalDate).
date - the date to discount toRuntimeException - if the result cannot be calculateddefault ZeroRateSensitivity zeroRatePointSensitivity(double yearFraction)
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 discountFactor(LocalDate).
The year fraction must be based on #relativeYearFraction(LocalDate).
yearFraction - the year fractionRuntimeException - if the result cannot be calculateddefault ZeroRateSensitivity zeroRatePointSensitivity(LocalDate date, Currency sensitivityCurrency)
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 discountFactor(LocalDate).
This method allows the currency of the sensitivity to differ from the currency of the market data.
date - the date to discount tosensitivityCurrency - the currency of the sensitivityRuntimeException - if the result cannot be calculatedZeroRateSensitivity zeroRatePointSensitivity(double yearFraction, Currency sensitivityCurrency)
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 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).
yearFraction - the year fractionsensitivityCurrency - the currency of the sensitivityRuntimeException - if the result cannot be calculatedCurrencyParameterSensitivities parameterSensitivity(ZeroRateSensitivity pointSensitivity)
This is used to convert a single point sensitivity to parameter sensitivity. The calculation typically involves multiplying the point and unit sensitivities.
pointSensitivity - the point sensitivity to convertRuntimeException - if the result cannot be calculatedCurrencyParameterSensitivities createParameterSensitivity(Currency currency, DoubleArray sensitivities)
In most cases, 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.
currency - the currencysensitivities - the sensitivity values, which must match the parameter countRuntimeException - if the result cannot be calculatedCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.