public final class IsdaCreditDiscountFactors extends Object implements CreditDiscountFactors, org.joda.beans.ImmutableBean, Serializable
This is used to price credit default swaps under ISDA standard model.
The underlying curve must be zero rate curve represented by InterpolatedNodalCurve for multiple data points
and InterpolatedNodalCurve for a single data point.
The zero rates must be interpolated by ProductLinearCurveInterpolator and extrapolated by
FlatCurveExtrapolator on the left and ProductLinearCurveExtrapolator on the right.
| Modifier and Type | Class and Description |
|---|---|
static class |
IsdaCreditDiscountFactors.Meta
The meta-bean for
IsdaCreditDiscountFactors. |
| 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.
|
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.
|
NodalCurve |
getCurve()
Gets the underlying curve.
|
DayCount |
getDayCount()
Obtains day count convention.
|
double |
getParameter(int parameterIndex) |
int |
getParameterCount() |
DoubleArray |
getParameterKeys()
Obtains the parameter keys of the underlying curve.
|
ParameterMetadata |
getParameterMetadata(int parameterIndex) |
LocalDate |
getValuationDate()
Gets the valuation date.
|
int |
hashCode() |
boolean |
isIsdaCompliant()
Checks if the instance is based on an ISDA compliant curve.
|
static IsdaCreditDiscountFactors.Meta |
meta()
The meta-bean for
IsdaCreditDiscountFactors. |
IsdaCreditDiscountFactors.Meta |
metaBean() |
static IsdaCreditDiscountFactors |
of(Currency currency,
LocalDate valuationDate,
CurveName curveName,
DoubleArray yearFractions,
DoubleArray zeroRates,
DayCount dayCount)
Creates an instance from year fraction and zero rate values.
|
static IsdaCreditDiscountFactors |
of(Currency currency,
LocalDate valuationDate,
NodalCurve curve)
Creates an instance from the underlying 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. |
String |
toString() |
IsdaCreditDiscountFactors |
withCurve(NodalCurve curve)
Returns a new instance with a different curve.
|
IsdaCreditDiscountFactors |
withParameter(int parameterIndex,
double newValue) |
IsdaCreditDiscountFactors |
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, of, zeroRate, zeroRatePointSensitivity, zeroRatePointSensitivity, zeroRatePointSensitivitypublic static IsdaCreditDiscountFactors of(Currency currency, LocalDate valuationDate, NodalCurve curve)
currency - the currencyvaluationDate - the valuation datecurve - the underlying curvepublic static IsdaCreditDiscountFactors of(Currency currency, LocalDate valuationDate, CurveName curveName, DoubleArray yearFractions, DoubleArray zeroRates, DayCount dayCount)
currency - the currencyvaluationDate - the valuation datecurveName - the curve nameyearFractions - the year fractionszeroRates - the zero ratesdayCount - the day countpublic boolean isIsdaCompliant()
CreditDiscountFactorsThis returns 'false' by default, and should be overridden when needed.
isIsdaCompliant in interface CreditDiscountFactorspublic <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 DoubleArray getParameterKeys()
CreditDiscountFactorsgetParameterKeys in interface CreditDiscountFactorspublic ParameterMetadata getParameterMetadata(int parameterIndex)
getParameterMetadata in interface ParameterizedDatapublic OptionalInt findParameterIndex(ParameterMetadata metadata)
findParameterIndex in interface ParameterizedDatapublic IsdaCreditDiscountFactors withParameter(int parameterIndex, double newValue)
withParameter in interface ParameterizedDatawithParameter in interface CreditDiscountFactorspublic IsdaCreditDiscountFactors withPerturbation(ParameterPerturbation perturbation)
withPerturbation in interface ParameterizedDatawithPerturbation in interface CreditDiscountFactorspublic DayCount getDayCount()
CreditDiscountFactorsThis is typically the day count convention of the underlying curve.
getDayCount in interface CreditDiscountFactorspublic double relativeYearFraction(LocalDate date)
CreditDiscountFactors
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 CreditDiscountFactorsdate - the datepublic double discountFactor(double yearFraction)
CreditDiscountFactors
The year fraction must be based on #relativeYearFraction(LocalDate).
discountFactor in interface CreditDiscountFactorsyearFraction - the year fractionpublic double zeroRate(double yearFraction)
CreditDiscountFactors
The year fraction must be based on #relativeYearFraction(LocalDate).
zeroRate in interface CreditDiscountFactorsyearFraction - the year fractionpublic ZeroRateSensitivity zeroRatePointSensitivity(double yearFraction, Currency sensitivityCurrency)
CreditDiscountFactors
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 CreditDiscountFactors.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 CreditDiscountFactorsyearFraction - the year fractionsensitivityCurrency - the currency of the sensitivitypublic CurrencyParameterSensitivities parameterSensitivity(ZeroRateSensitivity pointSensitivity)
CreditDiscountFactorsThis is used to convert a single point sensitivity to parameter sensitivity. The calculation typically involves multiplying the point and unit sensitivities.
parameterSensitivity in interface CreditDiscountFactorspointSensitivity - the point sensitivity to convertpublic CurrencyParameterSensitivities createParameterSensitivity(Currency currency, DoubleArray sensitivities)
CreditDiscountFactors
In most cases, CreditDiscountFactors.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 CreditDiscountFactorscurrency - the currencysensitivities - the sensitivity values, which must match the parameter countpublic DiscountFactors toDiscountFactors()
CreditDiscountFactorsDiscountFactors.toDiscountFactors in interface CreditDiscountFactorspublic IsdaCreditDiscountFactors withCurve(NodalCurve curve)
curve - the new curvepublic static IsdaCreditDiscountFactors.Meta meta()
IsdaCreditDiscountFactors.public IsdaCreditDiscountFactors.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic Currency getCurrency()
getCurrency in interface CreditDiscountFactorspublic LocalDate getValuationDate()
getValuationDate in interface MarketDataViewpublic NodalCurve getCurve()
The metadata of the curve must define a day count.
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.