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.

Serialized Form
• Nested Class Summary

Nested Classes
Modifier and Type Class Description
static class  LegalEntitySurvivalProbabilities.Meta
The meta-bean for LegalEntitySurvivalProbabilities.
• Method Summary

All Methods
Modifier and Type Method Description
boolean equals​(Object obj)
Currency getCurrency()
Gets the currency.
StandardId getLegalEntityId()
Gets the legal entity identifier.
DoubleArray getParameterKeys()
Obtains the parameter keys of the underlying curve.
CreditDiscountFactors getSurvivalProbabilities()
Gets the underlying curve.
LocalDate getValuationDate()
Gets the valuation date.
int hashCode()
static LegalEntitySurvivalProbabilities.Meta meta()
The meta-bean for LegalEntitySurvivalProbabilities.
LegalEntitySurvivalProbabilities.Meta metaBean()
static LegalEntitySurvivalProbabilities of​(StandardId legalEntityId, CreditDiscountFactors survivalProbabilities)
Creates an instance.
CurrencyParameterSensitivities parameterSensitivity​(CreditCurveZeroRateSensitivity pointSensitivity)
Calculates the parameter sensitivity from the point sensitivity.
double survivalProbability​(LocalDate date)
Gets the survival probability for the specified date.
String toString()
double zeroRate​(double yearFraction)
Gets the continuously compounded zero hazard rate for specified year fraction.
CreditCurveZeroRateSensitivity zeroRatePointSensitivity​(double yearFraction)
Calculates the zero rate point sensitivity at the specified year fraction.
CreditCurveZeroRateSensitivity zeroRatePointSensitivity​(double yearFraction, Currency sensitivityCurrency)
Calculates the zero rate point sensitivity at the specified year fraction specifying the currency of the sensitivity.
CreditCurveZeroRateSensitivity zeroRatePointSensitivity​(LocalDate date)
Calculates the zero rate point sensitivity at the specified date.
CreditCurveZeroRateSensitivity zeroRatePointSensitivity​(LocalDate date, Currency sensitivityCurrency)
Calculates the zero rate point sensitivity at the specified date specifying the currency of the sensitivity.
• Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait
• Methods inherited from interface org.joda.beans.Bean

property, propertyNames
• Method Detail

• of

public static LegalEntitySurvivalProbabilities of​(StandardId legalEntityId,
CreditDiscountFactors survivalProbabilities)
Creates an instance.
Parameters:
legalEntityId - the legal entity ID
survivalProbabilities - 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 of survivalProbability(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 of survivalProbability(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 of survivalProbability(LocalDate).

This method allows the currency of the sensitivity to differ from the currency of the market data.

Parameters:
date - the date
sensitivityCurrency - 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 of survivalProbability(LocalDate).

This method allows the currency of the sensitivity to differ from the currency of the market data.

Parameters:
yearFraction - the year fraction
sensitivityCurrency - 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 for LegalEntitySurvivalProbabilities.
Returns:
the meta-bean, not null
• metaBean

public LegalEntitySurvivalProbabilities.Meta metaBean()
Specified by:
metaBean in interface org.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
• equals

public boolean equals​(Object obj)
Overrides:
equals in class Object
• hashCode

public int hashCode()
Overrides:
hashCode in class Object
• toString

public String toString()
Overrides:
toString in class Object