public interface DiscountFactors 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.
| 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.
|
double |
discountFactorTimeDerivative(double yearFraction)
Returns the discount factor derivative with respect to the year fraction or time.
|
default double |
discountFactorWithSpread(double yearFraction,
double zSpread,
CompoundedRateType compoundedRateType,
int periodsPerYear)
Gets the discount factor for the specified year fraction with z-spread.
|
default double |
discountFactorWithSpread(LocalDate date,
double zSpread,
CompoundedRateType compoundedRateType,
int periodsPerYear)
Gets the discount factor for the specified date with z-spread.
|
Currency |
getCurrency()
Gets the currency.
|
static DiscountFactors |
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 |
withParameter(int parameterIndex,
double newValue) |
DiscountFactors |
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.
|
default ZeroRateSensitivity |
zeroRatePointSensitivityWithSpread(double yearFraction,
Currency sensitivityCurrency,
double zSpread,
CompoundedRateType compoundedRateType,
int periodsPerYear)
Calculates the zero rate point sensitivity with z-spread at the specified year fraction specifying
the currency of the sensitivity.
|
default ZeroRateSensitivity |
zeroRatePointSensitivityWithSpread(double yearFraction,
double zSpread,
CompoundedRateType compoundedRateType,
int periodsPerYear)
Calculates the zero rate point sensitivity with z-spread at the specified year fraction.
|
default ZeroRateSensitivity |
zeroRatePointSensitivityWithSpread(LocalDate date,
Currency sensitivityCurrency,
double zSpread,
CompoundedRateType compoundedRateType,
int periodsPerYear)
Calculates the zero rate point sensitivity with z-spread at the specified date specifying
the currency of the sensitivity.
|
default ZeroRateSensitivity |
zeroRatePointSensitivityWithSpread(LocalDate date,
double zSpread,
CompoundedRateType compoundedRateType,
int periodsPerYear)
Calculates the zero rate point sensitivity with z-spread at the specified date.
|
findData, getValuationDatefindParameterIndex, getParameter, getParameterCount, getParameterMetadatastatic DiscountFactors of(Currency currency, LocalDate valuationDate, Curve curve)
The curve is specified by an instance of Curve, such as InterpolatedNodalCurve.
The curve must have x-values of year fractions with
the day count specified. The y-values must be zero rates
or discount factors.
currency - the currencyvaluationDate - the valuation date for which the curve is validcurve - the underlying curveCurrency getCurrency()
The currency that discount factors are provided for.
DiscountFactors withParameter(int parameterIndex, double newValue)
withParameter in interface ParameterizedDataDiscountFactors withPerturbation(ParameterPerturbation perturbation)
withPerturbation in interface ParameterizedDatadouble 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 or after 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 obtaineddouble discountFactorTimeDerivative(double yearFraction)
The year fraction must be based on #relativeYearFraction(LocalDate).
yearFraction - the year fractionRuntimeException - if the value cannot be obtaineddefault double discountFactorWithSpread(LocalDate date, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
The discount factor represents the time value of money for the specified currency when comparing the valuation date to the specified date.
The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the discounting curve.
If the valuation date is on or after the specified date, the discount factor is 1.
date - the date to discount tozSpread - the z-spreadcompoundedRateType - the compounded rate typeperiodsPerYear - the number of periods per yearRuntimeException - if the value cannot be obtaineddefault double discountFactorWithSpread(double yearFraction,
double zSpread,
CompoundedRateType compoundedRateType,
int periodsPerYear)
The discount factor represents the time value of money for the specified currency when comparing the valuation date to the specified date.
The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the discounting curve.
If the valuation date is on or after the specified date, the discount factor is 1.
The year fraction must be based on #relativeYearFraction(LocalDate).
yearFraction - the year fractionzSpread - the z-spreadcompoundedRateType - the compounded rate typeperiodsPerYear - the number of periods per yearRuntimeException - 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 calculateddefault ZeroRateSensitivity zeroRatePointSensitivityWithSpread(LocalDate date, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
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 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.
date - the date to discount tozSpread - the z-spreadcompoundedRateType - the compounded rate typeperiodsPerYear - the number of periods per yearRuntimeException - if the result cannot be calculateddefault ZeroRateSensitivity zeroRatePointSensitivityWithSpread(double yearFraction, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
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 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.
The year fraction must be based on #relativeYearFraction(LocalDate).
yearFraction - the year fractionzSpread - the z-spreadcompoundedRateType - the compounded rate typeperiodsPerYear - the number of periods per yearRuntimeException - if the result cannot be calculateddefault ZeroRateSensitivity zeroRatePointSensitivityWithSpread(LocalDate date, Currency sensitivityCurrency, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
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 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.
date - the date to discount tosensitivityCurrency - the currency of the sensitivityzSpread - the z-spreadcompoundedRateType - the compounded rate typeperiodsPerYear - the number of periods per yearRuntimeException - if the result cannot be calculateddefault ZeroRateSensitivity zeroRatePointSensitivityWithSpread(double yearFraction, Currency sensitivityCurrency, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
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 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).
yearFraction - the year fractionsensitivityCurrency - the currency of the sensitivityzSpread - the z-spreadcompoundedRateType - the compounded rate typeperiodsPerYear - the number of periods per yearRuntimeException - 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.