Class LegalEntitySurvivalProbabilities
- java.lang.Object
-
- com.opengamma.strata.pricer.credit.LegalEntitySurvivalProbabilities
-
- All Implemented Interfaces:
Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class LegalEntitySurvivalProbabilities extends Object implements org.joda.beans.ImmutableBean, Serializable
The legal entity survival probabilities.This represents the survival probabilities of a legal entity for a single currency.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLegalEntitySurvivalProbabilities.MetaThe meta-bean forLegalEntitySurvivalProbabilities.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)CurrencygetCurrency()Gets the currency.StandardIdgetLegalEntityId()Gets the legal entity identifier.DoubleArraygetParameterKeys()Obtains the parameter keys of the underlying curve.CreditDiscountFactorsgetSurvivalProbabilities()Gets the underlying curve.LocalDategetValuationDate()Gets the valuation date.inthashCode()static LegalEntitySurvivalProbabilities.Metameta()The meta-bean forLegalEntitySurvivalProbabilities.LegalEntitySurvivalProbabilities.MetametaBean()static LegalEntitySurvivalProbabilitiesof(StandardId legalEntityId, CreditDiscountFactors survivalProbabilities)Creates an instance.CurrencyParameterSensitivitiesparameterSensitivity(CreditCurveZeroRateSensitivity pointSensitivity)Calculates the parameter sensitivity from the point sensitivity.doublesurvivalProbability(LocalDate date)Gets the survival probability for the specified date.StringtoString()doublezeroRate(double yearFraction)Gets the continuously compounded zero hazard rate for specified year fraction.CreditCurveZeroRateSensitivityzeroRatePointSensitivity(double yearFraction)Calculates the zero rate point sensitivity at the specified year fraction.CreditCurveZeroRateSensitivityzeroRatePointSensitivity(double yearFraction, Currency sensitivityCurrency)Calculates the zero rate point sensitivity at the specified year fraction specifying the currency of the sensitivity.CreditCurveZeroRateSensitivityzeroRatePointSensitivity(LocalDate date)Calculates the zero rate point sensitivity at the specified date.CreditCurveZeroRateSensitivityzeroRatePointSensitivity(LocalDate date, Currency sensitivityCurrency)Calculates the zero rate point sensitivity at the specified date specifying the currency of the sensitivity.
-
-
-
Method Detail
-
of
public static LegalEntitySurvivalProbabilities of(StandardId legalEntityId, CreditDiscountFactors survivalProbabilities)
Creates an instance.- Parameters:
legalEntityId- the legal entity IDsurvivalProbabilities- the survival probabilities- Returns:
- the instance
-
getCurrency
public Currency getCurrency()
Gets the currency.The currency that survival probabilities are provided for.
- Returns:
- the currency
-
getValuationDate
public LocalDate getValuationDate()
Gets the valuation date.The raw data in this provider is calibrated for this date.
- Returns:
- the valuation date
-
getParameterKeys
public DoubleArray getParameterKeys()
Obtains the parameter keys of the underlying curve.- Returns:
- the parameter keys
-
survivalProbability
public double survivalProbability(LocalDate date)
Gets the survival probability for the specified date.If the valuation date is on the specified date, the survival probability is 1.
- Parameters:
date- the date- Returns:
- the survival probability
- Throws:
RuntimeException- if the value cannot be obtained
-
zeroRate
public double zeroRate(double yearFraction)
Gets the continuously compounded zero hazard rate for specified year fraction.- Parameters:
yearFraction- the year fraction- Returns:
- the zero hazard rate
- Throws:
RuntimeException- if the value cannot be obtained
-
zeroRatePointSensitivity
public CreditCurveZeroRateSensitivity zeroRatePointSensitivity(LocalDate date)
Calculates the zero rate point sensitivity at the specified date.This returns a sensitivity instance referring to the zero hazard rate sensitivity of the points that were queried in the market data. The sensitivity typically has the value
(-survivalProbability * yearFraction). The sensitivity refers to the result ofsurvivalProbability(LocalDate).- Parameters:
date- the date- Returns:
- the point sensitivity of the zero rate
- Throws:
RuntimeException- if the result cannot be calculated
-
zeroRatePointSensitivity
public CreditCurveZeroRateSensitivity zeroRatePointSensitivity(double yearFraction)
Calculates the zero rate point sensitivity at the specified year fraction.This returns a sensitivity instance referring to the zero hazard rate sensitivity of the points that were queried in the market data. The sensitivity typically has the value
(-survivalProbability * yearFraction). The sensitivity refers to the result ofsurvivalProbability(LocalDate).- Parameters:
yearFraction- the year fraction- Returns:
- the point sensitivity of the zero rate
- Throws:
RuntimeException- if the result cannot be calculated
-
zeroRatePointSensitivity
public CreditCurveZeroRateSensitivity zeroRatePointSensitivity(LocalDate date, Currency sensitivityCurrency)
Calculates the zero rate point sensitivity at the specified date specifying the currency of the sensitivity.This returns a sensitivity instance referring to the zero hazard rate sensitivity of the points that were queried in the market data. The sensitivity typically has the value
(-survivalProbability * yearFraction). The sensitivity refers to the result ofsurvivalProbability(LocalDate).This method allows the currency of the sensitivity to differ from the currency of the market data.
- Parameters:
date- the datesensitivityCurrency- the currency of the sensitivity- Returns:
- the point sensitivity of the zero rate
- Throws:
RuntimeException- if the result cannot be calculated
-
zeroRatePointSensitivity
public CreditCurveZeroRateSensitivity zeroRatePointSensitivity(double yearFraction, Currency sensitivityCurrency)
Calculates the zero rate point sensitivity at the specified year fraction specifying the currency of the sensitivity.This returns a sensitivity instance referring to the zero hazard rate sensitivity of the points that were queried in the market data. The sensitivity typically has the value
(-survivalProbability * yearFraction). The sensitivity refers to the result ofsurvivalProbability(LocalDate).This method allows the currency of the sensitivity to differ from the currency of the market data.
- Parameters:
yearFraction- the year fractionsensitivityCurrency- the currency of the sensitivity- Returns:
- the point sensitivity of the zero rate
- Throws:
RuntimeException- if the result cannot be calculated
-
parameterSensitivity
public CurrencyParameterSensitivities parameterSensitivity(CreditCurveZeroRateSensitivity pointSensitivity)
Calculates the parameter sensitivity from the point sensitivity.This is used to convert a single point sensitivity to parameter sensitivity. The calculation typically involves multiplying the point and unit sensitivities.
- Parameters:
pointSensitivity- the point sensitivity to convert- Returns:
- the parameter sensitivity
- Throws:
RuntimeException- if the result cannot be calculated
-
meta
public static LegalEntitySurvivalProbabilities.Meta meta()
The meta-bean forLegalEntitySurvivalProbabilities.- Returns:
- the meta-bean, not null
-
metaBean
public LegalEntitySurvivalProbabilities.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getLegalEntityId
public StandardId getLegalEntityId()
Gets the legal entity identifier.This identifier is used for the reference legal entity of a credit derivative.
- Returns:
- the value of the property, not null
-
getSurvivalProbabilities
public CreditDiscountFactors getSurvivalProbabilities()
Gets the underlying curve.The metadata of the curve must define a day count.
- Returns:
- the value of the property, not null
-
-