Class SmileSectionUtils
- Namespace
- NanoQL.TermStructures
- Assembly
- NanoQL.dll
A smile section's grid of strikes and call prices and its arbitrage-free region: the widest range of the grid, around the at-the-money point, on which the call prices decrease and are convex in the strike.
public sealed class SmileSectionUtils
- Inheritance
-
SmileSectionUtils
- Inherited Members
Remarks
The moneyness is absolute (the strike less the at-the-money level) for a normal section and relative (the shifted strike over the shifted level) for a shifted lognormal one. A shifted lognormal grid starts at a moneyness of 0, the strike at minus the shift, whose call price is the shifted level. Where a strike falls outside the section's strike range, the range's end takes its place, once.
Immutable: the grids and the region are computed at construction. The relative moneyness of a range's end is its
shifted strike over the shifted level, as at the grid's other points. QuantLib divides the shifted strike by the
unshifted level (smilesectionutils.cpp:100-101, :107-108), so with a shift the endpoints' moneyness
is off: the grid can come out unsorted, and the at-the-money point is then located in the wrong place.
Constructors
SmileSectionUtils(SmileSection, ReadOnlySpan<double>, double?, bool)
Initializes a new instance of the SmileSectionUtils class.
public SmileSectionUtils(SmileSection section, ReadOnlySpan<double> moneynessGrid = default, double? atm = null, bool deleteArbitragePoints = false)
Parameters
sectionSmileSectionThe smile section.
moneynessGridReadOnlySpan<double>The moneyness grid, strictly increasing and, for a shifted lognormal section, non negative; empty for QuantLib's default grid of the section's type.
atmdouble?The at-the-money level; null, QuantLib's
Null<Real>(), for the section's own.deleteArbitragePointsboolWhether the points next to the arbitrage-free region are removed until the region holds the whole grid.
Exceptions
- ArgumentNullException
sectionis null.- ArgumentException
The moneyness grid isn't strictly increasing, or holds a negative value for a shifted lognormal section; or no at-the-money level is given and the section has none.
- NanoQLException
The at-the-money point lies too close to the grid's ends, or the arbitrage-free region holds fewer than two points.
Methods
ArbitragefreeIndices()
The arbitrage-free region's indices in the grid.
public (int Left, int Right) ArbitragefreeIndices()
Returns
ArbitragefreeRegion()
The arbitrage-free region's strikes.
public (double Left, double Right) ArbitragefreeRegion()
Returns
AtmLevel()
The at-the-money level.
public double AtmLevel()
Returns
- double
The level given, or the section's.
CallPrices()
The undiscounted call prices at the strikes.
public ImmutableArray<double> CallPrices()
Returns
- ImmutableArray<double>
The prices.
MoneyGrid()
The moneyness grid.
public ImmutableArray<double> MoneyGrid()
Returns
- ImmutableArray<double>
The moneyness of each strike.
StrikeGrid()
The strike grid.
public ImmutableArray<double> StrikeGrid()
Returns
- ImmutableArray<double>
The strikes.