Class OptionSurfaceDataInterpolated
- All Implemented Interfaces:
VolatilitySurface
The class extends OptionSurfaceData by adding finmath-native
interpolation
and quoting-convention conversion. The underlying market data may be supplied
either as individual OptionData quotes or as OptionSmileData
objects.
The surface does not assume a rectangular grid. Different maturities may have different strike grids and different numbers of option quotes.
Internally, the market data are represented as nodal points
(maturity, strike, value). The sorted representation is ordered by
maturity first and by strike within maturity. The interpolated value at
(T,K) is obtained by:
- interpolating each maturity smile in strike at
K; - interpolating the resulting values in maturity at
T.
This class is intentionally responsible only for interpolation and quoting-convention conversion.
- Author:
- Alessandro Gnoatto
-
Nested Class Summary
Nested classes/interfaces inherited from interface VolatilitySurface
VolatilitySurface.QuotingConvention -
Constructor Summary
ConstructorsConstructorDescriptionOptionSurfaceDataInterpolated(OptionData[] optionQuotes, DiscountCurve discountCurve, DiscountCurve equityForwardCurve) Creates an interpolated surface from individual option quotes.OptionSurfaceDataInterpolated(OptionData[] optionQuotes, DiscountCurve discountCurve, DiscountCurve equityForwardCurve, RationalFunctionInterpolation.InterpolationMethod strikeInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod strikeExtrapolationMethod, RationalFunctionInterpolation.InterpolationMethod maturityInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod maturityExtrapolationMethod) Creates an interpolated surface from individual option quotes.OptionSurfaceDataInterpolated(OptionSmileData[] smiles, DiscountCurve discountCurve, DiscountCurve equityForwardCurve) Creates an interpolated surface from option smiles.OptionSurfaceDataInterpolated(OptionSmileData[] smiles, DiscountCurve discountCurve, DiscountCurve equityForwardCurve, RationalFunctionInterpolation.InterpolationMethod strikeInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod strikeExtrapolationMethod, RationalFunctionInterpolation.InterpolationMethod maturityInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod maturityExtrapolationMethod) Creates an interpolated surface from option smiles. -
Method Summary
Modifier and TypeMethodDescriptiongetCloneForQuotingConvention(VolatilitySurface.QuotingConvention newQuotingConvention) Creates a clone of this surface with another quoting convention.doublegetInterpolatedValue(double maturity, double strike) Returns the interpolated value in the surface's native quoting convention.double[]Returns the sorted unique maturities.Returns the extrapolation method in maturity direction.Returns the interpolation method in maturity direction.double[]Returns the flattened node maturities.double[]Returns the flattened node strikes.double[]Returns the flattened node values in the native quoting convention.Returns the sorted smiles used by this surface.Returns the extrapolation method in strike direction.Returns the interpolation method in strike direction.doublegetValue(double maturity, double strike) Returns the value in the default quoting convention of the surface.doublegetValue(double maturity, double strike, VolatilitySurface.QuotingConvention quotingConvention) Returns the value in the requested quoting convention.doublegetValue(AnalyticModel model, double maturity, double strike, VolatilitySurface.QuotingConvention quotingConvention) Returns the value in the requested quoting convention.of(OptionData[] optionQuotes, DiscountCurve discountCurve, DiscountCurve equityForwardCurve) Creates an interpolated surface from sorted individual option quotes.of(OptionData[] optionQuotes, DiscountCurve discountCurve, DiscountCurve equityForwardCurve, RationalFunctionInterpolation.InterpolationMethod strikeInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod strikeExtrapolationMethod, RationalFunctionInterpolation.InterpolationMethod maturityInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod maturityExtrapolationMethod) Creates an interpolated surface from sorted individual option quotes.of(OptionSmileData[] smiles, DiscountCurve discountCurve, DiscountCurve equityForwardCurve) Creates an interpolated surface from sorted option smiles.of(OptionSmileData[] smiles, DiscountCurve discountCurve, DiscountCurve equityForwardCurve, RationalFunctionInterpolation.InterpolationMethod strikeInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod strikeExtrapolationMethod, RationalFunctionInterpolation.InterpolationMethod maturityInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod maturityExtrapolationMethod) Creates an interpolated surface from sorted option smiles.ofUnsorted(OptionData[] optionQuotes, DiscountCurve discountCurve, DiscountCurve equityForwardCurve) Creates an interpolated surface from unsorted individual option quotes.ofUnsorted(OptionData[] optionQuotes, DiscountCurve discountCurve, DiscountCurve equityForwardCurve, RationalFunctionInterpolation.InterpolationMethod strikeInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod strikeExtrapolationMethod, RationalFunctionInterpolation.InterpolationMethod maturityInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod maturityExtrapolationMethod) Creates an interpolated surface from unsorted individual option quotes.ofUnsorted(OptionSmileData[] smiles, DiscountCurve discountCurve, DiscountCurve equityForwardCurve) Creates an interpolated surface from unsorted option smiles.ofUnsorted(OptionSmileData[] smiles, DiscountCurve discountCurve, DiscountCurve equityForwardCurve, RationalFunctionInterpolation.InterpolationMethod strikeInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod strikeExtrapolationMethod, RationalFunctionInterpolation.InterpolationMethod maturityInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod maturityExtrapolationMethod) Creates an interpolated surface from unsorted option smiles.Methods inherited from class OptionSurfaceData
getDiscountCurve, getEquityForwardCurve, getName, getQuotingConvention, getReferenceDate, getSmile, getSurfaceMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface VolatilitySurface
getName, getQuotingConvention, getReferenceDate
-
Constructor Details
-
OptionSurfaceDataInterpolated
public OptionSurfaceDataInterpolated(OptionData[] optionQuotes, DiscountCurve discountCurve, DiscountCurve equityForwardCurve) Creates an interpolated surface from individual option quotes.The input quotes are required to be sorted by maturity and by strike within each maturity. Use
ofUnsorted(OptionData[], DiscountCurve, DiscountCurve)if the input quotes are not sorted.- Parameters:
optionQuotes- The individual option quotes.discountCurve- The discount curve.equityForwardCurve- The equity forward curve.
-
OptionSurfaceDataInterpolated
public OptionSurfaceDataInterpolated(OptionData[] optionQuotes, DiscountCurve discountCurve, DiscountCurve equityForwardCurve, RationalFunctionInterpolation.InterpolationMethod strikeInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod strikeExtrapolationMethod, RationalFunctionInterpolation.InterpolationMethod maturityInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod maturityExtrapolationMethod) Creates an interpolated surface from individual option quotes.The input quotes are required to be sorted by maturity and by strike within each maturity. Use
ofUnsorted(OptionData[], DiscountCurve, DiscountCurve, InterpolationMethod, ExtrapolationMethod, InterpolationMethod, ExtrapolationMethod)if the input quotes are not sorted.- Parameters:
optionQuotes- The individual option quotes.discountCurve- The discount curve.equityForwardCurve- The equity forward curve.strikeInterpolationMethod- The interpolation method in strike direction.strikeExtrapolationMethod- The extrapolation method in strike direction.maturityInterpolationMethod- The interpolation method in maturity direction.maturityExtrapolationMethod- The extrapolation method in maturity direction.
-
OptionSurfaceDataInterpolated
public OptionSurfaceDataInterpolated(OptionSmileData[] smiles, DiscountCurve discountCurve, DiscountCurve equityForwardCurve) Creates an interpolated surface from option smiles.The input smiles are required to be sorted by maturity. The strikes inside each smile are required to be sorted increasingly and to be unique. Use
ofUnsorted(OptionSmileData[], DiscountCurve, DiscountCurve)if the input smiles or strikes are not sorted.- Parameters:
smiles- The option smiles.discountCurve- The discount curve.equityForwardCurve- The equity forward curve.
-
OptionSurfaceDataInterpolated
public OptionSurfaceDataInterpolated(OptionSmileData[] smiles, DiscountCurve discountCurve, DiscountCurve equityForwardCurve, RationalFunctionInterpolation.InterpolationMethod strikeInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod strikeExtrapolationMethod, RationalFunctionInterpolation.InterpolationMethod maturityInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod maturityExtrapolationMethod) Creates an interpolated surface from option smiles.The input smiles are required to be sorted by maturity. The strikes inside each smile are required to be sorted increasingly and to be unique. Use
ofUnsorted(OptionSmileData[], DiscountCurve, DiscountCurve, InterpolationMethod, ExtrapolationMethod, InterpolationMethod, ExtrapolationMethod)if the input smiles or strikes are not sorted.- Parameters:
smiles- The option smiles.discountCurve- The discount curve.equityForwardCurve- The equity forward curve.strikeInterpolationMethod- The interpolation method in strike direction.strikeExtrapolationMethod- The extrapolation method in strike direction.maturityInterpolationMethod- The interpolation method in maturity direction.maturityExtrapolationMethod- The extrapolation method in maturity direction.
-
-
Method Details
-
of
public static OptionSurfaceDataInterpolated of(OptionData[] optionQuotes, DiscountCurve discountCurve, DiscountCurve equityForwardCurve) Creates an interpolated surface from sorted individual option quotes.- Parameters:
optionQuotes- The individual option quotes, sorted by maturity and strike.discountCurve- The discount curve.equityForwardCurve- The equity forward curve.- Returns:
- The interpolated option surface.
-
of
public static OptionSurfaceDataInterpolated of(OptionData[] optionQuotes, DiscountCurve discountCurve, DiscountCurve equityForwardCurve, RationalFunctionInterpolation.InterpolationMethod strikeInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod strikeExtrapolationMethod, RationalFunctionInterpolation.InterpolationMethod maturityInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod maturityExtrapolationMethod) Creates an interpolated surface from sorted individual option quotes.- Parameters:
optionQuotes- The individual option quotes, sorted by maturity and strike.discountCurve- The discount curve.equityForwardCurve- The equity forward curve.strikeInterpolationMethod- The interpolation method in strike direction.strikeExtrapolationMethod- The extrapolation method in strike direction.maturityInterpolationMethod- The interpolation method in maturity direction.maturityExtrapolationMethod- The extrapolation method in maturity direction.- Returns:
- The interpolated option surface.
-
ofUnsorted
public static OptionSurfaceDataInterpolated ofUnsorted(OptionData[] optionQuotes, DiscountCurve discountCurve, DiscountCurve equityForwardCurve) Creates an interpolated surface from unsorted individual option quotes.The input quotes are sorted by maturity and by strike within maturity. Duplicate nodes are not allowed.
- Parameters:
optionQuotes- The individual option quotes.discountCurve- The discount curve.equityForwardCurve- The equity forward curve.- Returns:
- The interpolated option surface.
-
ofUnsorted
public static OptionSurfaceDataInterpolated ofUnsorted(OptionData[] optionQuotes, DiscountCurve discountCurve, DiscountCurve equityForwardCurve, RationalFunctionInterpolation.InterpolationMethod strikeInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod strikeExtrapolationMethod, RationalFunctionInterpolation.InterpolationMethod maturityInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod maturityExtrapolationMethod) Creates an interpolated surface from unsorted individual option quotes.The input quotes are sorted by maturity and by strike within maturity. Duplicate nodes are not allowed.
- Parameters:
optionQuotes- The individual option quotes.discountCurve- The discount curve.equityForwardCurve- The equity forward curve.strikeInterpolationMethod- The interpolation method in strike direction.strikeExtrapolationMethod- The extrapolation method in strike direction.maturityInterpolationMethod- The interpolation method in maturity direction.maturityExtrapolationMethod- The extrapolation method in maturity direction.- Returns:
- The interpolated option surface.
-
of
public static OptionSurfaceDataInterpolated of(OptionSmileData[] smiles, DiscountCurve discountCurve, DiscountCurve equityForwardCurve) Creates an interpolated surface from sorted option smiles.- Parameters:
smiles- The option smiles, sorted by maturity and with sorted strikes.discountCurve- The discount curve.equityForwardCurve- The equity forward curve.- Returns:
- The interpolated option surface.
-
of
public static OptionSurfaceDataInterpolated of(OptionSmileData[] smiles, DiscountCurve discountCurve, DiscountCurve equityForwardCurve, RationalFunctionInterpolation.InterpolationMethod strikeInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod strikeExtrapolationMethod, RationalFunctionInterpolation.InterpolationMethod maturityInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod maturityExtrapolationMethod) Creates an interpolated surface from sorted option smiles.- Parameters:
smiles- The option smiles, sorted by maturity and with sorted strikes.discountCurve- The discount curve.equityForwardCurve- The equity forward curve.strikeInterpolationMethod- The interpolation method in strike direction.strikeExtrapolationMethod- The extrapolation method in strike direction.maturityInterpolationMethod- The interpolation method in maturity direction.maturityExtrapolationMethod- The extrapolation method in maturity direction.- Returns:
- The interpolated option surface.
-
ofUnsorted
public static OptionSurfaceDataInterpolated ofUnsorted(OptionSmileData[] smiles, DiscountCurve discountCurve, DiscountCurve equityForwardCurve) Creates an interpolated surface from unsorted option smiles.The smiles are sorted by maturity and the strikes inside each smile are sorted increasingly. Duplicate maturities or duplicate strikes inside a smile are not allowed.
- Parameters:
smiles- The option smiles.discountCurve- The discount curve.equityForwardCurve- The equity forward curve.- Returns:
- The interpolated option surface.
-
ofUnsorted
public static OptionSurfaceDataInterpolated ofUnsorted(OptionSmileData[] smiles, DiscountCurve discountCurve, DiscountCurve equityForwardCurve, RationalFunctionInterpolation.InterpolationMethod strikeInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod strikeExtrapolationMethod, RationalFunctionInterpolation.InterpolationMethod maturityInterpolationMethod, RationalFunctionInterpolation.ExtrapolationMethod maturityExtrapolationMethod) Creates an interpolated surface from unsorted option smiles.The smiles are sorted by maturity and the strikes inside each smile are sorted increasingly. Duplicate maturities or duplicate strikes inside a smile are not allowed.
- Parameters:
smiles- The option smiles.discountCurve- The discount curve.equityForwardCurve- The equity forward curve.strikeInterpolationMethod- The interpolation method in strike direction.strikeExtrapolationMethod- The extrapolation method in strike direction.maturityInterpolationMethod- The interpolation method in maturity direction.maturityExtrapolationMethod- The extrapolation method in maturity direction.- Returns:
- The interpolated option surface.
-
getValue
public double getValue(double maturity, double strike) Returns the value in the default quoting convention of the surface.- Overrides:
getValuein classOptionSurfaceData- Parameters:
maturity- The option maturity.strike- The option strike.- Returns:
- The interpolated value.
-
getValue
public double getValue(double maturity, double strike, VolatilitySurface.QuotingConvention quotingConvention) Returns the value in the requested quoting convention.- Specified by:
getValuein interfaceVolatilitySurface- Overrides:
getValuein classOptionSurfaceData- Parameters:
maturity- The option maturity.strike- The option strike.quotingConvention- The requested quoting convention.- Returns:
- The interpolated and, if necessary, converted value.
-
getValue
public double getValue(AnalyticModel model, double maturity, double strike, VolatilitySurface.QuotingConvention quotingConvention) Returns the value in the requested quoting convention.The model argument is currently not used, since the discount curve and the equity forward curve are stored in the surface.
- Specified by:
getValuein interfaceVolatilitySurface- Overrides:
getValuein classOptionSurfaceData- Parameters:
model- An analytic model.maturity- The option maturity.strike- The option strike.quotingConvention- The requested quoting convention.- Returns:
- The interpolated and, if necessary, converted value.
-
getInterpolatedValue
public double getInterpolatedValue(double maturity, double strike) Returns the interpolated value in the surface's native quoting convention.- Parameters:
maturity- The option maturity.strike- The option strike.- Returns:
- The interpolated value in the surface's native quoting convention.
-
getCloneForQuotingConvention
public OptionSurfaceDataInterpolated getCloneForQuotingConvention(VolatilitySurface.QuotingConvention newQuotingConvention) Creates a clone of this surface with another quoting convention.The conversion is performed at the original surface nodes. The interpolation settings are preserved.
- Parameters:
newQuotingConvention- The new quoting convention.- Returns:
- A surface with the requested quoting convention.
-
getSmiles
Returns the sorted smiles used by this surface.- Returns:
- The sorted smiles.
-
getNodeMaturities
public double[] getNodeMaturities()Returns the flattened node maturities.- Returns:
- The node maturities.
-
getNodeStrikes
public double[] getNodeStrikes()Returns the flattened node strikes.- Returns:
- The node strikes.
-
getNodeValues
public double[] getNodeValues()Returns the flattened node values in the native quoting convention.- Returns:
- The node values.
-
getMaturities
public double[] getMaturities()Returns the sorted unique maturities.- Overrides:
getMaturitiesin classOptionSurfaceData- Returns:
- The sorted unique maturities.
-
getStrikeInterpolationMethod
Returns the interpolation method in strike direction.- Returns:
- The strike interpolation method.
-
getStrikeExtrapolationMethod
Returns the extrapolation method in strike direction.- Returns:
- The strike extrapolation method.
-
getMaturityInterpolationMethod
Returns the interpolation method in maturity direction.- Returns:
- The maturity interpolation method.
-
getMaturityExtrapolationMethod
Returns the extrapolation method in maturity direction.- Returns:
- The maturity extrapolation method.
-