Interface CreditRatesProvider
-
- All Known Implementing Classes:
ImmutableCreditRatesProvider
public interface CreditRatesProvider
The rates provider, used to calculate analytic measures.The primary usage of this provider is to price credit default swaps on a legal entity. This includes credit curves, discounting curves and recovery rate curves.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CreditDiscountFactors
discountFactors(Currency currency)
Gets the discount factors for a currency.<T> Optional<T>
findData(MarketDataName<T> name)
Finds the market data with the specified name.LocalDate
getValuationDate()
Gets the valuation date.CurrencyParameterSensitivities
parameterSensitivity(PointSensitivities pointSensitivities)
Computes the parameter sensitivity.RecoveryRates
recoveryRates(StandardId legalEntityId)
Gets the recovery rates for a standard ID.CurrencyParameterSensitivity
singleCreditCurveParameterSensitivity(PointSensitivities pointSensitivities, StandardId legalEntityId, Currency currency)
Computes the parameter sensitivity for a specific credit curve.CurrencyParameterSensitivity
singleDiscountCurveParameterSensitivity(PointSensitivities pointSensitivities, Currency currency)
Computes the parameter sensitivity for a specific discount curve.LegalEntitySurvivalProbabilities
survivalProbabilities(StandardId legalEntityId, Currency currency)
Gets the survival probabilities for a standard ID and a currency.ImmutableCreditRatesProvider
toImmutableCreditRatesProvider()
Converts this provider to an equivalentImmutableCreditRatesProvider
.
-
-
-
Method Detail
-
getValuationDate
LocalDate getValuationDate()
Gets the valuation date.The raw data in this provider is calibrated for this date.
- Returns:
- the valuation date
-
survivalProbabilities
LegalEntitySurvivalProbabilities survivalProbabilities(StandardId legalEntityId, Currency currency)
Gets the survival probabilities for a standard ID and a currency.If both the standard ID and currency are matched, the relevant
LegalEntitySurvivalProbabilities
is returned.If the valuation date is on the specified date, the survival probability is 1.
- Parameters:
legalEntityId
- the standard ID of legal entity to get the discount factors forcurrency
- the currency to get the discount factors for- Returns:
- the survival probabilities
- Throws:
IllegalArgumentException
- if the survival probabilities are not available
-
discountFactors
CreditDiscountFactors discountFactors(Currency currency)
Gets the discount factors for a currency.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.
- Parameters:
currency
- the currency to get the discount factors for- Returns:
- the discount factors for the specified currency
-
recoveryRates
RecoveryRates recoveryRates(StandardId legalEntityId)
Gets the recovery rates for a standard ID.If both the standard ID and currency are matched, the relevant
RecoveryRates
is returned.- Parameters:
legalEntityId
- the standard ID of legal entity to get the discount factors for- Returns:
- the recovery rates
- Throws:
IllegalArgumentException
- if the recovery rates are not available
-
parameterSensitivity
CurrencyParameterSensitivities parameterSensitivity(PointSensitivities pointSensitivities)
Computes the parameter sensitivity.This computes the
CurrencyParameterSensitivities
associated with thePointSensitivities
. This corresponds to the projection of the point sensitivity to the curve internal parameters representation.The sensitivities handled here are
CreditCurveZeroRateSensitivity
,ZeroRateSensitivity
. For the other sensitivity objects, useRatesProvider
instead.- Parameters:
pointSensitivities
- the point sensitivity- Returns:
- the sensitivity to the curve parameters
-
singleCreditCurveParameterSensitivity
CurrencyParameterSensitivity singleCreditCurveParameterSensitivity(PointSensitivities pointSensitivities, StandardId legalEntityId, Currency currency)
Computes the parameter sensitivity for a specific credit curve.The credit curve is specified by
legalEntityId
andcurrency
.- Parameters:
pointSensitivities
- the point sensitivitylegalEntityId
- the legal entitycurrency
- the currency- Returns:
- the sensitivity to the curve parameters
-
singleDiscountCurveParameterSensitivity
CurrencyParameterSensitivity singleDiscountCurveParameterSensitivity(PointSensitivities pointSensitivities, Currency currency)
Computes the parameter sensitivity for a specific discount curve.The discount curve is specified by
currency
.- Parameters:
pointSensitivities
- the point sensitivitycurrency
- the currency- Returns:
- the sensitivity to the curve parameters
-
findData
<T> Optional<T> findData(MarketDataName<T> name)
Finds the market data with the specified name.This is most commonly used to find a
Curve
using aCurveName
. If the market data cannot be found, empty is returned.- Type Parameters:
T
- the type of the market data value- Parameters:
name
- the name to find- Returns:
- the market data value, empty if not found
-
toImmutableCreditRatesProvider
ImmutableCreditRatesProvider toImmutableCreditRatesProvider()
Converts this provider to an equivalentImmutableCreditRatesProvider
.- Returns:
- the equivalent immutable legal entity provider
-
-