java.lang.Object
net.finmath.marketdata.model.volatilities.AbstractVolatilitySurface
net.finmath.marketdata.model.volatilities.CapletVolatilities
- All Implemented Interfaces:
Cloneable
,VolatilitySurface
A very simple container for Caplet volatilities.
It performs piecewise constant interpolation (discretization) in maturity dimension on iso-moneyness lines
and uses the default interpolation from the CurveFromInterpolationPoints class in strike dimension.
It allows to convert from several quoting conventions.
It needs a forward curve and a discount curve. The tenor length of the Caplet is inferred
from the forward curve.
- Version:
- 1.0
- Author:
- Christian Fries
- To dos:
- Need to add forward and discount curve to support implied vol.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.finmath.marketdata.model.volatilities.VolatilitySurface
VolatilitySurface.QuotingConvention
-
Constructor Summary
ConstructorDescriptionCapletVolatilities(String name, LocalDate referenceDate, ForwardCurve forwardCurve, double[] maturities, double[] strikes, double[] volatilities, VolatilitySurface.QuotingConvention volatilityConvention, DiscountCurve discountCurve)
-
Method Summary
Modifier and TypeMethodDescriptionstatic AbstractVolatilitySurface
double
getValue(double maturity, double strike, VolatilitySurface.QuotingConvention quotingConvention)
Returns the price or implied volatility for the corresponding maturity and strike.double
getValue(AnalyticModel model, double maturity, double strike, VolatilitySurface.QuotingConvention quotingConvention)
Returns the price or implied volatility for the corresponding maturity and strike.Methods inherited from class net.finmath.marketdata.model.volatilities.AbstractVolatilitySurface
clone, convertFromTo, convertFromTo, getDaycountConvention, getDiscountCurve, getForwardCurve, getName, getQuotingConvention, getReferenceDate, toString
-
Constructor Details
-
CapletVolatilities
public CapletVolatilities(String name, LocalDate referenceDate, ForwardCurve forwardCurve, double[] maturities, double[] strikes, double[] volatilities, VolatilitySurface.QuotingConvention volatilityConvention, DiscountCurve discountCurve)- Parameters:
name
- The name of this volatility surface.referenceDate
- The reference date for this volatility surface, i.e., the date which defined t=0.forwardCurve
- The underlying forward curve.maturities
- The vector of maturities of the quotes.strikes
- The vector of strikes of the quotes.volatilities
- The vector of volatilities of the quotes.volatilityConvention
- The quoting convention of the volatilities provided.discountCurve
- The associated discount curve.
-
-
Method Details
-
getValue
public double getValue(double maturity, double strike, VolatilitySurface.QuotingConvention quotingConvention)Description copied from interface:VolatilitySurface
Returns the price or implied volatility for the corresponding maturity and strike.- Parameters:
maturity
- The option maturity for which the price or implied volatility is requested.strike
- The option strike for which the price or implied volatility is requested.quotingConvention
- The quoting convention to be used for the return value.- Returns:
- The price or implied volatility depending on the quoting convention.
-
getValue
public double getValue(AnalyticModel model, double maturity, double strike, VolatilitySurface.QuotingConvention quotingConvention)Description copied from interface:VolatilitySurface
Returns the price or implied volatility for the corresponding maturity and strike.- Parameters:
model
- An analytic model providing a context. Some curves do not need this (may be null).maturity
- The option maturity for which the price or implied volatility is requested.strike
- The option strike for which the price or implied volatility is requested.quotingConvention
- The quoting convention to be used for the return value.- Returns:
- The price or implied volatility depending on the quoting convention.
-
fromFile
- Throws:
FileNotFoundException
-