Class ImmutableCreditRatesProvider
- java.lang.Object
-
- com.opengamma.strata.pricer.credit.ImmutableCreditRatesProvider
-
- All Implemented Interfaces:
CreditRatesProvider
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class ImmutableCreditRatesProvider extends Object implements CreditRatesProvider, org.joda.beans.ImmutableBean, Serializable
The immutable 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.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableCreditRatesProvider.Builder
The bean-builder forImmutableCreditRatesProvider
.static class
ImmutableCreditRatesProvider.Meta
The meta-bean forImmutableCreditRatesProvider
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableCreditRatesProvider.Builder
builder()
Returns a builder used to create an instance of the bean.CreditDiscountFactors
discountFactors(Currency currency)
Gets the discount factors for a currency.boolean
equals(Object obj)
<T> Optional<T>
findData(MarketDataName<T> name)
Finds the market data with the specified name.LocalDate
getValuationDate()
Gets the valuation date.int
hashCode()
static ImmutableCreditRatesProvider.Meta
meta()
The meta-bean forImmutableCreditRatesProvider
.ImmutableCreditRatesProvider.Meta
metaBean()
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.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.ImmutableCreditRatesProvider
toImmutableCreditRatesProvider()
Converts this provider to an equivalentImmutableCreditRatesProvider
.String
toString()
-
-
-
Method Detail
-
survivalProbabilities
public LegalEntitySurvivalProbabilities survivalProbabilities(StandardId legalEntityId, Currency currency)
Description copied from interface:CreditRatesProvider
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.
- Specified by:
survivalProbabilities
in interfaceCreditRatesProvider
- 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
-
discountFactors
public CreditDiscountFactors discountFactors(Currency currency)
Description copied from interface:CreditRatesProvider
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.
- Specified by:
discountFactors
in interfaceCreditRatesProvider
- Parameters:
currency
- the currency to get the discount factors for- Returns:
- the discount factors for the specified currency
-
recoveryRates
public RecoveryRates recoveryRates(StandardId legalEntityId)
Description copied from interface:CreditRatesProvider
Gets the recovery rates for a standard ID.If both the standard ID and currency are matched, the relevant
RecoveryRates
is returned.- Specified by:
recoveryRates
in interfaceCreditRatesProvider
- Parameters:
legalEntityId
- the standard ID of legal entity to get the discount factors for- Returns:
- the recovery rates
-
parameterSensitivity
public CurrencyParameterSensitivities parameterSensitivity(PointSensitivities pointSensitivities)
Description copied from interface:CreditRatesProvider
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.- Specified by:
parameterSensitivity
in interfaceCreditRatesProvider
- Parameters:
pointSensitivities
- the point sensitivity- Returns:
- the sensitivity to the curve parameters
-
singleCreditCurveParameterSensitivity
public CurrencyParameterSensitivity singleCreditCurveParameterSensitivity(PointSensitivities pointSensitivities, StandardId legalEntityId, Currency currency)
Description copied from interface:CreditRatesProvider
Computes the parameter sensitivity for a specific credit curve.The credit curve is specified by
legalEntityId
andcurrency
.- Specified by:
singleCreditCurveParameterSensitivity
in interfaceCreditRatesProvider
- Parameters:
pointSensitivities
- the point sensitivitylegalEntityId
- the legal entitycurrency
- the currency- Returns:
- the sensitivity to the curve parameters
-
singleDiscountCurveParameterSensitivity
public CurrencyParameterSensitivity singleDiscountCurveParameterSensitivity(PointSensitivities pointSensitivities, Currency currency)
Description copied from interface:CreditRatesProvider
Computes the parameter sensitivity for a specific discount curve.The discount curve is specified by
currency
.- Specified by:
singleDiscountCurveParameterSensitivity
in interfaceCreditRatesProvider
- Parameters:
pointSensitivities
- the point sensitivitycurrency
- the currency- Returns:
- the sensitivity to the curve parameters
-
findData
public <T> Optional<T> findData(MarketDataName<T> name)
Description copied from interface:CreditRatesProvider
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.- Specified by:
findData
in interfaceCreditRatesProvider
- 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
public ImmutableCreditRatesProvider toImmutableCreditRatesProvider()
Description copied from interface:CreditRatesProvider
Converts this provider to an equivalentImmutableCreditRatesProvider
.- Specified by:
toImmutableCreditRatesProvider
in interfaceCreditRatesProvider
- Returns:
- the equivalent immutable legal entity provider
-
meta
public static ImmutableCreditRatesProvider.Meta meta()
The meta-bean forImmutableCreditRatesProvider
.- Returns:
- the meta-bean, not null
-
builder
public static ImmutableCreditRatesProvider.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public ImmutableCreditRatesProvider.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getValuationDate
public LocalDate getValuationDate()
Gets the valuation date.All curves and other data items in this provider are calibrated for this date.
- Specified by:
getValuationDate
in interfaceCreditRatesProvider
- Returns:
- the value of the property, not null
-
toBuilder
public ImmutableCreditRatesProvider.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-