public final class NormalSwaptionExpiryTenorStrikeVolatilities extends Object implements NormalSwaptionVolatilities, org.joda.beans.ImmutableBean, Serializable
The volatility is represented by a cube on the expiry, swap tenor and strike dimensions.
| Modifier and Type | Class and Description |
|---|---|
static class |
NormalSwaptionExpiryTenorStrikeVolatilities.Meta
The meta-bean for
NormalSwaptionExpiryTenorStrikeVolatilities. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
<T> Optional<T> |
findData(MarketDataName<T> name) |
OptionalInt |
findParameterIndex(ParameterMetadata metadata) |
FixedFloatSwapConvention |
getConvention()
Gets the swap convention that the volatilities are to be used for.
|
Cube |
getCube()
Gets the normal volatility cube.
|
SwaptionVolatilitiesName |
getName()
Gets the name of these volatilities.
|
double |
getParameter(int parameterIndex) |
int |
getParameterCount() |
ParameterMetadata |
getParameterMetadata(int parameterIndex) |
ZonedDateTime |
getValuationDateTime()
Gets the valuation date-time.
|
int |
hashCode() |
static NormalSwaptionExpiryTenorStrikeVolatilities.Meta |
meta()
The meta-bean for
NormalSwaptionExpiryTenorStrikeVolatilities. |
NormalSwaptionExpiryTenorStrikeVolatilities.Meta |
metaBean() |
static NormalSwaptionExpiryTenorStrikeVolatilities |
of(FixedFloatSwapConvention convention,
ZonedDateTime valuationDateTime,
Cube cube)
Obtains an instance from the implied volatility cube 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.
|
NormalSwaptionExpiryTenorStrikeVolatilities |
withParameter(int parameterIndex,
double newValue) |
NormalSwaptionExpiryTenorStrikeVolatilities |
withPerturbation(ParameterPerturbation perturbation) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetVolatilityTypegetValuationDate, parameterSensitivity, volatilitypublic static NormalSwaptionExpiryTenorStrikeVolatilities of(FixedFloatSwapConvention convention, ZonedDateTime valuationDateTime, Cube cube)
The cube is specified by an instance of Cube, such as InterpolatedNodalCube.
The cube must contain the correct metadata:
ValueType.YEAR_FRACTION
ValueType.YEAR_FRACTION
ValueType.STRIKE
ValueType.NORMAL_VOLATILITY
CubeInfoType.DAY_COUNT
Cubes.normalVolatilityByExpiryTenorStrike(String, DayCount).convention - the swap convention that the volatilities are to be used forvaluationDateTime - the valuation date-timecube - the implied volatility cubepublic SwaptionVolatilitiesName getName()
SwaptionVolatilitiesgetName in interface SwaptionVolatilitiespublic <T> Optional<T> findData(MarketDataName<T> name)
findData in interface MarketDataViewpublic int getParameterCount()
getParameterCount in interface ParameterizedDatapublic double getParameter(int parameterIndex)
getParameter in interface ParameterizedDatapublic ParameterMetadata getParameterMetadata(int parameterIndex)
getParameterMetadata in interface ParameterizedDatapublic OptionalInt findParameterIndex(ParameterMetadata metadata)
findParameterIndex in interface ParameterizedDatapublic NormalSwaptionExpiryTenorStrikeVolatilities withParameter(int parameterIndex, double newValue)
withParameter in interface ParameterizedDatawithParameter in interface NormalSwaptionVolatilitieswithParameter in interface SwaptionVolatilitiespublic NormalSwaptionExpiryTenorStrikeVolatilities withPerturbation(ParameterPerturbation perturbation)
withPerturbation in interface ParameterizedDatawithPerturbation in interface NormalSwaptionVolatilitieswithPerturbation in interface SwaptionVolatilitiespublic 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 SwaptionVolatilitiesexpiry - 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 SwaptionVolatilitiespointSensitivities - 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 SwaptionVolatilitiesexpiry - 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)
SwaptionVolatilitiesThis 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 SwaptionVolatilitiesexpiry - 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)
SwaptionVolatilitiesThis 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 SwaptionVolatilitiesexpiry - 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)
SwaptionVolatilitiesThis 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 SwaptionVolatilitiesexpiry - 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)
SwaptionVolatilitiesThis 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 SwaptionVolatilitiesexpiry - 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)
SwaptionVolatilitiesWhen the date is after the valuation date (and potentially time), the returned number is negative.
relativeTime in interface SwaptionVolatilitiesdateTime - the date-time to find the relative year fraction ofpublic double tenor(LocalDate startDate, LocalDate endDate)
SwaptionVolatilitiestenor in interface SwaptionVolatilitiesstartDate - the start dateendDate - the end datepublic static NormalSwaptionExpiryTenorStrikeVolatilities.Meta meta()
NormalSwaptionExpiryTenorStrikeVolatilities.public NormalSwaptionExpiryTenorStrikeVolatilities.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic FixedFloatSwapConvention getConvention()
getConvention in interface SwaptionVolatilitiespublic ZonedDateTime getValuationDateTime()
The volatilities are calibrated for this date-time.
getValuationDateTime in interface SwaptionVolatilitiespublic Cube getCube()
The x-value of the cube is the expiry, as a year fraction. The y-value of the cube is the swap tenor, as a year fraction rounded to the month. The z-value of the cube is the strike, as a rate.
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.