public final class NormalSwaptionExpiryTenorVolatilities extends Object implements NormalSwaptionVolatilities, org.joda.beans.ImmutableBean, Serializable
The volatility is represented by a surface on the expiry and swap tenor dimensions.
Modifier and Type | Class and Description |
---|---|
static class |
NormalSwaptionExpiryTenorVolatilities.Meta
The meta-bean for
NormalSwaptionExpiryTenorVolatilities . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
<T> Optional<T> |
findData(MarketDataName<T> name) |
OptionalInt |
findParameterIndex(ParameterMetadata metadata) |
FixedIborSwapConvention |
getConvention()
Gets the swap convention that the volatilities are to be used for.
|
SwaptionVolatilitiesName |
getName()
Gets the name of these volatilities.
|
double |
getParameter(int parameterIndex) |
int |
getParameterCount() |
ParameterMetadata |
getParameterMetadata(int parameterIndex) |
Surface |
getSurface()
Gets the normal volatility surface.
|
ZonedDateTime |
getValuationDateTime()
Gets the valuation date-time.
|
int |
hashCode() |
static NormalSwaptionExpiryTenorVolatilities.Meta |
meta()
The meta-bean for
NormalSwaptionExpiryTenorVolatilities . |
NormalSwaptionExpiryTenorVolatilities.Meta |
metaBean() |
static NormalSwaptionExpiryTenorVolatilities |
of(FixedIborSwapConvention convention,
ZonedDateTime valuationDateTime,
Surface surface)
Obtains an instance from the implied volatility surface and the date-time for which it is valid.
|
CurrencyParameterSensitivities |
parameterSensitivity(PointSensitivities pointSensitivities)
Calculates the parameter sensitivity.
|
double |
price(double expiry,
double tenor,
PutCall putCall,
double strike,
double forward,
double volatility)
Calculates the price.
|
double |
priceDelta(double expiry,
double tenor,
PutCall putCall,
double strike,
double forward,
double volatility)
Calculates the price delta.
|
double |
priceGamma(double expiry,
double tenor,
PutCall putCall,
double strike,
double forward,
double volatility)
Calculates the price gamma.
|
double |
priceTheta(double expiry,
double tenor,
PutCall putCall,
double strike,
double forward,
double volatility)
Calculates the price theta.
|
double |
priceVega(double expiry,
double tenor,
PutCall putCall,
double strike,
double forward,
double volatility)
Calculates the price vega.
|
double |
relativeTime(ZonedDateTime dateTime)
Converts a time and date to a relative year fraction.
|
double |
tenor(LocalDate startDate,
LocalDate endDate)
Calculates the tenor of the swap based on its start date and end date.
|
String |
toString() |
double |
volatility(double expiry,
double tenor,
double strike,
double forwardRate)
Calculates the volatility at the specified expiry.
|
NormalSwaptionExpiryTenorVolatilities |
withParameter(int parameterIndex,
double newValue) |
NormalSwaptionExpiryTenorVolatilities |
withPerturbation(ParameterPerturbation perturbation) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getVolatilityType
getValuationDate, parameterSensitivity, volatility
public static NormalSwaptionExpiryTenorVolatilities of(FixedIborSwapConvention convention, ZonedDateTime valuationDateTime, Surface surface)
The surface is specified by an instance of Surface
, such as InterpolatedNodalSurface
.
The surface must contain the correct metadata:
ValueType.YEAR_FRACTION
ValueType.YEAR_FRACTION
ValueType.NORMAL_VOLATILITY
SurfaceInfoType.DAY_COUNT
Surfaces.normalVolatilityByExpiryTenor(String, DayCount)
.convention
- the swap convention that the volatilities are to be used forvaluationDateTime
- the valuation date-timesurface
- the implied volatility surfacepublic SwaptionVolatilitiesName getName()
SwaptionVolatilities
getName
in interface SwaptionVolatilities
public <T> Optional<T> findData(MarketDataName<T> name)
findData
in interface MarketDataView
public int getParameterCount()
getParameterCount
in interface ParameterizedData
public double getParameter(int parameterIndex)
getParameter
in interface ParameterizedData
public ParameterMetadata getParameterMetadata(int parameterIndex)
getParameterMetadata
in interface ParameterizedData
public OptionalInt findParameterIndex(ParameterMetadata metadata)
findParameterIndex
in interface ParameterizedData
public NormalSwaptionExpiryTenorVolatilities withParameter(int parameterIndex, double newValue)
withParameter
in interface ParameterizedData
withParameter
in interface NormalSwaptionVolatilities
withParameter
in interface SwaptionVolatilities
public NormalSwaptionExpiryTenorVolatilities withPerturbation(ParameterPerturbation perturbation)
withPerturbation
in interface ParameterizedData
withPerturbation
in interface NormalSwaptionVolatilities
withPerturbation
in interface SwaptionVolatilities
public double volatility(double expiry, double tenor, double strike, double forwardRate)
SwaptionVolatilities
This relies on expiry supplied by SwaptionVolatilities.relativeTime(ZonedDateTime)
.
This relies on tenor supplied by SwaptionVolatilities.tenor(LocalDate, LocalDate)
.
volatility
in interface SwaptionVolatilities
expiry
- the time to expiry as a year fractiontenor
- the tenor of the instrument as a year fractionstrike
- the option strike rateforwardRate
- the forward rate of the underlying swappublic CurrencyParameterSensitivities parameterSensitivity(PointSensitivities pointSensitivities)
SwaptionVolatilities
This computes the CurrencyParameterSensitivities
associated with the PointSensitivities
.
This corresponds to the projection of the point sensitivity to the internal parameters representation.
parameterSensitivity
in interface SwaptionVolatilities
pointSensitivities
- the point sensitivitiespublic double price(double expiry, double tenor, PutCall putCall, double strike, double forward, double volatility)
SwaptionVolatilities
This relies on expiry supplied by SwaptionVolatilities.relativeTime(ZonedDateTime)
.
This relies on tenor supplied by SwaptionVolatilities.tenor(LocalDate, LocalDate)
.
This relies on volatility supplied by SwaptionVolatilities.volatility(double, double, double, double)
.
price
in interface SwaptionVolatilities
expiry
- the time to expiry as a year fractiontenor
- the tenor of the instrument as a year fractionputCall
- whether the option is put or callstrike
- the option strike rateforward
- the forward rate of the underlying swapvolatility
- the volatilitypublic double priceDelta(double expiry, double tenor, PutCall putCall, double strike, double forward, double volatility)
SwaptionVolatilities
This is the forward driftless delta.
This relies on expiry supplied by SwaptionVolatilities.relativeTime(ZonedDateTime)
.
This relies on tenor supplied by SwaptionVolatilities.tenor(LocalDate, LocalDate)
.
This relies on volatility supplied by SwaptionVolatilities.volatility(double, double, double, double)
.
priceDelta
in interface SwaptionVolatilities
expiry
- the time to expiry as a year fractiontenor
- the tenor of the instrument as a year fractionputCall
- whether the option is put or callstrike
- the option strike rateforward
- the forward rate of the underlying swapvolatility
- the volatilitypublic double priceGamma(double expiry, double tenor, PutCall putCall, double strike, double forward, double volatility)
SwaptionVolatilities
This is the second order sensitivity of the forward option value to the forward.
This relies on expiry supplied by SwaptionVolatilities.relativeTime(ZonedDateTime)
.
This relies on tenor supplied by SwaptionVolatilities.tenor(LocalDate, LocalDate)
.
This relies on volatility supplied by SwaptionVolatilities.volatility(double, double, double, double)
.
priceGamma
in interface SwaptionVolatilities
expiry
- the time to expiry as a year fractiontenor
- the tenor of the instrument as a year fractionputCall
- whether the option is put or callstrike
- the option strike rateforward
- the forward rate of the underlying swapvolatility
- the volatilitypublic double priceTheta(double expiry, double tenor, PutCall putCall, double strike, double forward, double volatility)
SwaptionVolatilities
This is the driftless sensitivity of the present value to a change in time to maturity.
This relies on expiry supplied by SwaptionVolatilities.relativeTime(ZonedDateTime)
.
This relies on tenor supplied by SwaptionVolatilities.tenor(LocalDate, LocalDate)
.
This relies on volatility supplied by SwaptionVolatilities.volatility(double, double, double, double)
.
priceTheta
in interface SwaptionVolatilities
expiry
- the time to expiry as a year fractiontenor
- the tenor of the instrument as a year fractionputCall
- whether the option is put or callstrike
- the option strike rateforward
- the forward rate of the underlying swapvolatility
- the volatilitypublic double priceVega(double expiry, double tenor, PutCall putCall, double strike, double forward, double volatility)
SwaptionVolatilities
This is the sensitivity of the option forward price to the implied volatility.
This relies on expiry supplied by SwaptionVolatilities.relativeTime(ZonedDateTime)
.
This relies on tenor supplied by SwaptionVolatilities.tenor(LocalDate, LocalDate)
.
This relies on volatility supplied by SwaptionVolatilities.volatility(double, double, double, double)
.
priceVega
in interface SwaptionVolatilities
expiry
- the time to expiry as a year fractiontenor
- the tenor of the instrument as a year fractionputCall
- whether the option is put or callstrike
- the option strike rateforward
- the forward rate of the underlying swapvolatility
- the volatilitypublic double relativeTime(ZonedDateTime dateTime)
SwaptionVolatilities
When the date is after the valuation date (and potentially time), the returned number is negative.
relativeTime
in interface SwaptionVolatilities
dateTime
- the date-time to find the relative year fraction ofpublic double tenor(LocalDate startDate, LocalDate endDate)
SwaptionVolatilities
tenor
in interface SwaptionVolatilities
startDate
- the start dateendDate
- the end datepublic static NormalSwaptionExpiryTenorVolatilities.Meta meta()
NormalSwaptionExpiryTenorVolatilities
.public NormalSwaptionExpiryTenorVolatilities.Meta metaBean()
metaBean
in interface org.joda.beans.Bean
public FixedIborSwapConvention getConvention()
getConvention
in interface SwaptionVolatilities
public ZonedDateTime getValuationDateTime()
The volatilities are calibrated for this date-time.
getValuationDateTime
in interface SwaptionVolatilities
public Surface getSurface()
The x-value of the surface is the expiry, as a year fraction. The y-value of the surface is the swap tenor, as a year fraction rounded to the month.
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.