## Interface BondYieldVolatilities

• All Superinterfaces:
MarketDataView, ParameterizedData
All Known Implementing Classes:
NormalBondYieldExpiryDurationVolatilities

public interface BondYieldVolatilities
extends MarketDataView, ParameterizedData
Volatilities for bond options.

The volatilities are stored as bond yield equivalent volatilities but are converted to bond price volatilities through the formula "price volatility = duration * yield * yield volatility".

• ### Method Summary

All Methods
Modifier and Type Method Description
Currency getCurrency()
Gets the currency for which the data is valid.
BondVolatilitiesName getName()
Gets the name of these volatilities.
default LocalDate getValuationDate()
Gets the valuation date.
ZonedDateTime getValuationDateTime()
Gets the valuation date-time.
ValueType getVolatilityType()
Gets the type of volatility returned by the volatility(double, double, double, double) method.
CurrencyParameterSensitivities parameterSensitivity​(PointSensitivities pointSensitivities)
Calculates the parameter sensitivity.
default CurrencyParameterSensitivities parameterSensitivity​(PointSensitivity... pointSensitivities)
Calculates the parameter sensitivity.
default double priceVolatilityEquivalent​(double duration, double yieldVolatility)
Calculates the price volatility equivalent to the yield volatility.
default double priceVolatilityEquivalent​(double expiry, double duration, double strike, double forward)
Calculates the price volatility equivalent to the yield volatility.
default double priceVolatilityEquivalent​(ZonedDateTime expiryDateTime, double duration, double strike, double forward)
Calculates the price volatility equivalent to the yield volatility.
default ValueDerivatives priceVolatilityEquivalentAd​(double duration, double yieldVolatility)
Calculates the price volatility equivalent to the yield volatility and its derivatives.
default ValueDerivatives priceVolatilityEquivalentAd​(double expiry, double duration, double strike, double forward)
Calculates the price volatility equivalent to the yield volatility and its derivatives.
default ValueDerivatives priceVolatilityEquivalentAd​(ZonedDateTime expiryDateTime, double duration, double strike, double forward)
Calculates the price volatility equivalent to the yield volatility and its derivatives.
double relativeTime​(ZonedDateTime dateTime)
Converts a time and date to a relative year fraction.
double volatility​(double expiry, double duration, double strike, double forward)
Calculates the volatility at the specified expiry.
default double volatility​(ZonedDateTime expiryDateTime, double duration, double strike, double forward)
Calculates the volatility at the specified expiry.
BondYieldVolatilities withParameter​(int parameterIndex, double newValue)
Returns a copy of the data with the value at the specified index altered.
BondYieldVolatilities withPerturbation​(ParameterPerturbation perturbation)
Returns a perturbed copy of the data.
• ### Methods inherited from interface com.opengamma.strata.market.MarketDataView

findData
• ### Methods inherited from interface com.opengamma.strata.market.param.ParameterizedData

findParameterIndex, getParameter, getParameterCount, getParameterMetadata
• ### Method Detail

• #### getCurrency

Currency getCurrency()
Gets the currency for which the data is valid.
Returns:
the currency
• #### getName

BondVolatilitiesName getName()
Gets the name of these volatilities.
Returns:
the name
• #### getValuationDateTime

ZonedDateTime getValuationDateTime()
Gets the valuation date-time.

The volatilities are calibrated for this date-time.

Returns:
the valuation date-time
• #### getValuationDate

default LocalDate getValuationDate()
Gets the valuation date.

The volatilities are calibrated for this date.

Specified by:
getValuationDate in interface MarketDataView
Returns:
the valuation date
• #### withParameter

BondYieldVolatilities withParameter​(int parameterIndex,
double newValue)
Description copied from interface: ParameterizedData
Returns a copy of the data with the value at the specified index altered.

This instance is immutable and unaffected by this method call.

Specified by:
withParameter in interface ParameterizedData
Parameters:
parameterIndex - the zero-based index of the parameter to get
newValue - the new value for the specified parameter
Returns:
a parameterized data instance based on this with the specified parameter altered
• #### withPerturbation

BondYieldVolatilities withPerturbation​(ParameterPerturbation perturbation)
Description copied from interface: ParameterizedData
Returns a perturbed copy of the data.

The perturbation instance will be invoked once for each parameter in this instance, returning the perturbed value for that parameter. The result of this method is a new instance that is based on those perturbed values.

This instance is immutable and unaffected by this method call.

Specified by:
withPerturbation in interface ParameterizedData
Parameters:
perturbation - the perturbation to apply
Returns:
a parameterized data instance based on this with the specified perturbation applied
• #### volatility

double volatility​(double expiry,
double duration,
double strike,
double forward)
Calculates the volatility at the specified expiry.

This relies on expiry supplied by relativeTime(ZonedDateTime).

Parameters:
expiry - the time to expiry as a year fraction
duration - the modified duration of the instrument as a year fraction
strike - the strike yield
forward - the forward yield of the underlying bond
Returns:
the volatility
Throws:
RuntimeException - if the value cannot be obtained
• #### volatility

default double volatility​(ZonedDateTime expiryDateTime,
double duration,
double strike,
double forward)
Calculates the volatility at the specified expiry.
Parameters:
expiryDateTime - the option expiry
duration - the modified duration of the instrument as a year fraction
strike - the strike yield
forward - the forward yield of the underlying bond
Returns:
the volatility
Throws:
RuntimeException - if the value cannot be obtained
• #### priceVolatilityEquivalent

default double priceVolatilityEquivalent​(double expiry,
double duration,
double strike,
double forward)
Calculates the price volatility equivalent to the yield volatility.
Parameters:
expiry - the time to expiry as a year fraction
duration - the modified duration of the instrument as a year fraction
strike - the strike yield
forward - the forward yield of the underlying bond
Returns:
the price volatility

default ValueDerivatives priceVolatilityEquivalentAd​(double expiry,
double duration,
double strike,
double forward)
Calculates the price volatility equivalent to the yield volatility and its derivatives.

The derivatives are in the following order:

• [0] derivative with respect to the duration
• [1] derivative with respect to the yieldVolatility
Parameters:
expiry - the time to expiry as a year fraction
duration - the modified duration of the instrument as a year fraction
strike - the strike yield
forward - the forward yield of the underlying bond
Returns:
the price volatility
• #### priceVolatilityEquivalent

default double priceVolatilityEquivalent​(ZonedDateTime expiryDateTime,
double duration,
double strike,
double forward)
Calculates the price volatility equivalent to the yield volatility.
Parameters:
expiryDateTime - the option expiry
duration - the modified duration of the instrument as a year fraction
strike - the strike yield
forward - the forward yield of the underlying bond
Returns:
the price volatility

default ValueDerivatives priceVolatilityEquivalentAd​(ZonedDateTime expiryDateTime,
double duration,
double strike,
double forward)
Calculates the price volatility equivalent to the yield volatility and its derivatives.

The derivatives are in the following order:

• [0] derivative with respect to the duration
• [1] derivative with respect to the yieldVolatility
Parameters:
expiryDateTime - the option expiry
duration - the modified duration of the instrument as a year fraction
strike - the strike yield
forward - the forward yield of the underlying bond
Returns:
the price volatility
• #### priceVolatilityEquivalent

default double priceVolatilityEquivalent​(double duration,
double yieldVolatility)
Calculates the price volatility equivalent to the yield volatility.
Parameters:
duration - the modified duration
yieldVolatility - the yield volatility
Returns:
the price volatility

default ValueDerivatives priceVolatilityEquivalentAd​(double duration,
double yieldVolatility)
Calculates the price volatility equivalent to the yield volatility and its derivatives.

The derivatives are in the following order:

• [0] derivative with respect to the duration
• [1] derivative with respect to the yieldVolatility
Parameters:
duration - the modified duration
yieldVolatility - the yield volatility
Returns:
the price volatility
• #### parameterSensitivity

default CurrencyParameterSensitivities parameterSensitivity​(PointSensitivity... pointSensitivities)
Calculates the parameter sensitivity.

This computes the CurrencyParameterSensitivities associated with the PointSensitivities. This corresponds to the projection of the point sensitivity to the internal parameters representation.

Parameters:
pointSensitivities - the point sensitivities
Returns:
the sensitivity to the underlying parameters
• #### parameterSensitivity

CurrencyParameterSensitivities parameterSensitivity​(PointSensitivities pointSensitivities)
Calculates the parameter sensitivity.

This computes the CurrencyParameterSensitivities associated with the PointSensitivities. This corresponds to the projection of the point sensitivity to the internal parameters representation.

Parameters:
pointSensitivities - the point sensitivities
Returns:
the sensitivity to the underlying parameters
• #### relativeTime

double relativeTime​(ZonedDateTime dateTime)
Converts a time and date to a relative year fraction.

When the date is after the valuation date (and potentially time), the returned number is negative.

Parameters:
dateTime - the date-time to find the relative year fraction of
Returns:
the relative year fraction