| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
QuantLib.TermStructure.InflationVolatility
Synopsis
- type YoYOptionletVolatilitySurface = GenVolatilityTermStructure CYoYOptionletVolatilitySurface
- type YoYCapFloorTermPriceSurface = GenTermStructure CYoYCapFloorTermPriceSurface
- type CPICapFloorTermPriceSurface = GenTermStructure CCPICapFloorTermPriceSurface
- type CPIVolatilitySurface = GenVolatilityTermStructure CCPIVolatilitySurface
- constantYoyOptionletVolatility :: GenQuote q -> Word -> Calendar -> BusinessDayConvention -> DayCounter -> (Word, TimeUnit) -> Frequency -> Bool -> Double -> Double -> VolatilityType -> Double -> IO YoYOptionletVolatilitySurface
- kInterpolatedYoyOptionletVolatilitySurfaceBlack :: Word -> Calendar -> BusinessDayConvention -> DayCounter -> YoYCapFloorTermPriceSurface -> YoYInflationIndex -> GenYieldTermStructure y -> Double -> Interpolation -> IO YoYOptionletVolatilitySurface
- kInterpolatedYoyOptionletVolatilitySurfaceUnitDisplacedBlack :: Word -> Calendar -> BusinessDayConvention -> DayCounter -> YoYCapFloorTermPriceSurface -> YoYInflationIndex -> GenYieldTermStructure y -> Double -> Interpolation -> IO YoYOptionletVolatilitySurface
- kInterpolatedYoyOptionletVolatilitySurfaceBachelier :: Word -> Calendar -> BusinessDayConvention -> DayCounter -> YoYCapFloorTermPriceSurface -> YoYInflationIndex -> GenYieldTermStructure y -> Double -> Interpolation -> IO YoYOptionletVolatilitySurface
- yoyCapFloorTermPriceSurface :: Word -> (Word, TimeUnit) -> YoYInflationIndex -> CPIInterpolationType -> GenYieldTermStructure y -> DayCounter -> Calendar -> BusinessDayConvention -> [Double] -> [Double] -> [(Word, TimeUnit)] -> RealMatrix -> RealMatrix -> Interpolation2D -> Interpolation -> IO YoYCapFloorTermPriceSurface
- cpiCapFloorTermPriceSurface :: Double -> Double -> (Word, TimeUnit) -> Calendar -> BusinessDayConvention -> DayCounter -> ZeroInflationIndex -> CPIInterpolationType -> GenYieldTermStructure y -> [Double] -> [Double] -> [(Word, TimeUnit)] -> RealMatrix -> RealMatrix -> Interpolation2D -> IO CPICapFloorTermPriceSurface
- constantCpiVolatility :: GenQuote q -> Word -> Calendar -> BusinessDayConvention -> DayCounter -> (Word, TimeUnit) -> Frequency -> Bool -> IO CPIVolatilitySurface
- yoyOptionletVolatility :: YoYOptionletVolatilitySurface -> Day -> Double -> Maybe (Word, TimeUnit) -> Bool -> IO Double
- yoyOptionletTotalVariance :: YoYOptionletVolatilitySurface -> Day -> Double -> Maybe (Word, TimeUnit) -> Bool -> IO Double
- yoyCapFloorBaseDate :: YoYCapFloorTermPriceSurface -> IO Day
- yoyCapFloorAtmYoySwapDateRates :: YoYCapFloorTermPriceSurface -> IO [(Day, Double)]
- yoyCapFloorAtmYoySwapTimeRates :: YoYCapFloorTermPriceSurface -> IO [(Double, Double)]
- yoyCapFloorAtmYoySwapRate :: YoYCapFloorTermPriceSurface -> Day -> Bool -> IO Double
- yoyCapFloorAtmYoyRate :: YoYCapFloorTermPriceSurface -> Day -> Maybe (Word, TimeUnit) -> Bool -> IO Double
- yoyCapFloorStrikes :: YoYCapFloorTermPriceSurface -> IO [Double]
- cpiVolatility :: CPIVolatilitySurface -> Day -> Double -> Maybe (Word, TimeUnit) -> Bool -> IO Double
- cpiTotalVariance :: CPIVolatilitySurface -> Day -> Double -> Maybe (Word, TimeUnit) -> Bool -> IO Double
Types
type YoYOptionletVolatilitySurface = GenVolatilityTermStructure CYoYOptionletVolatilitySurface Source #
A YoY-inflation optionlet vol surface, quoted via volatility/totalVariance at
(maturity, strike) pairs rather than QuantLib's usual (option date, tenor, strike) grid, since
inflation caplets observe a single index fixing rather than a forward rate. A plain
VolatilityTermStructure leaf like CapFloorTermVolSurface, constructed and consumed via a
Handle (mirroring OptionletVolatilityStructure, since it feeds
yoyInflationBlackCapFloorEngine et al. exactly the way
OptionletVolatilityStructure feeds blackCapFloorEngineFromVolatilityStructure).
See the hierarchy under GenTermStructure.
type YoYCapFloorTermPriceSurface = GenTermStructure CYoYCapFloorTermPriceSurface Source #
Prices YoY cap/floors by cap/floor-surface intersection and put/call parity, deriving an
ATM YoY swap curve as a side effect -- the market-data input the YoY optionlet stripper
(kInterpolatedYoyOptionletVolatilitySurfaceBlack
et al.) bootstraps from. A plain TermStructure leaf, constructed and consumed by
shared_ptr like CPICapFloorTermPriceSurface, never a Handle. Takes independent
Interpolation2D (cap/floor price grid) and Interpolation (per-maturity) choices --
a different template (InterpolatedYoYCapFloorTermPriceSurface) from
CPICapFloorTermPriceSurfaces InterpolatedCPICapFloorTermPriceSurface, hence the separate
2-D/1-D pair rather than CPICapFloorTermPriceSurfaces single Interpolation2D.
See the hierarchy under GenTermStructure.
type CPICapFloorTermPriceSurface = GenTermStructure CCPICapFloorTermPriceSurface Source #
Prices CPI cap/floors by interpolation and put/call parity off a market strike/maturity
price grid, not by any vol model (see CPICapFloors own comment) -- a plain TermStructure
leaf, constructed and consumed by shared_ptr like CommodityCurve, never a Handle (wrapped
into one at the point of use, e.g. interpolatingCpiCapFloorEngine).
Takes an Interpolation2D choice for the cap/floor price grid -- a different template
(InterpolatedCPICapFloorTermPriceSurface) from YoYCapFloorTermPriceSurfaces
InterpolatedYoYCapFloorTermPriceSurface, hence its own single 2-D slot rather than
YoYCapFloorTermPriceSurfaces separate 2-D/1-D pair.
See the hierarchy under GenTermStructure.
type CPIVolatilitySurface = GenVolatilityTermStructure CCPIVolatilitySurface Source #
A CPI (zero-inflation) volatility surface, quoted via volatility/totalVariance at
(maturity, strike) pairs -- same shape as YoYOptionletVolatilitySurface, a plain
VolatilityTermStructure leaf constructed and consumed via a Handle. Unlike
YoYOptionletVolatilitySurface it feeds no pricing engine in QL 1.43: CPICapFloor prices
purely off CPICapFloorTermPriceSurface via
interpolatingCpiCapFloorEngine, and CPICouponPricer (the type that
would consume this) is itself explicitly unfinished upstream for vol-dependent coupons (no
concrete descendant exists to bind, unlike YoYInflationCouponPricers three) -- so this type
stands alone as a queryable surface, not (yet) as engine/pricer plumbing.
See the hierarchy under GenTermStructure.
Constructors
YoY volatility and price surfaces
constantYoyOptionletVolatility Source #
Arguments
| :: GenQuote q | |
| -> Word | settlementDays |
| -> Calendar | |
| -> BusinessDayConvention | |
| -> DayCounter | |
| -> (Word, TimeUnit) | observationLag |
| -> Frequency | |
| -> Bool | indexIsInterpolated |
| -> Double | minStrike |
| -> Double | maxStrike |
| -> VolatilityType | |
| -> Double | displacement |
| -> IO YoYOptionletVolatilitySurface |
Constant YoY-inflation optionlet vol surface, no maturity/strike dependence. Mirrors
constantOptionletVolatility, taking a GenQuote rather
than a plain Double per the std::variant/overload-collapse rule (the flat case is already
reachable via simpleQuote). Not the only concrete leaf of this type any
more -- see kInterpolatedYoyOptionletVolatilitySurfaceBlack for the market-quote-bootstrapped
alternative.
kInterpolatedYoyOptionletVolatilitySurfaceBlack Source #
Arguments
| :: Word | settlementDays |
| -> Calendar | |
| -> BusinessDayConvention | |
| -> DayCounter | |
| -> YoYCapFloorTermPriceSurface | capFloorPrices |
| -> YoYInflationIndex | index |
| -> GenYieldTermStructure y | nominalTermStructure |
| -> Double | slope |
| -> Interpolation | |
| -> IO YoYOptionletVolatilitySurface |
Strips a YoYOptionletVolatilitySurface from a YoYCapFloorTermPriceSurface by bootstrapping
a per-strike vol curve against Black-priced YoY caps/floors (mirrors upstream's own
testYoYPriceSurfaceToVol: an InterpolatedYoYOptionletStripper solving each strike's initial
vol, then a KInterpolatedYoYOptionletVolatilitySurface interpolating across strikes, both
sharing the given Interpolation -- neither is exposed as its own type, since nothing in
upstream reaches them from outside this one bootstrap; see this function's C shim for the full
pipeline). index/nominalTermStructure price the null-vol engine the stripper solves
against; slope is the assumed initial caplet-vol slope for strikes past the edge of good
price data (a negative slope for typically low/flat short-dated extreme-strike prices, per
upstream's own comment -- too extreme a slope can leave no arbitrage-free solution).
kInterpolatedYoyOptionletVolatilitySurfaceUnitDisplacedBlack Source #
Arguments
| :: Word | settlementDays |
| -> Calendar | |
| -> BusinessDayConvention | |
| -> DayCounter | |
| -> YoYCapFloorTermPriceSurface | capFloorPrices |
| -> YoYInflationIndex | index |
| -> GenYieldTermStructure y | nominalTermStructure |
| -> Double | slope |
| -> Interpolation | |
| -> IO YoYOptionletVolatilitySurface |
As kInterpolatedYoyOptionletVolatilitySurfaceBlack, but unit-displaced Black.
kInterpolatedYoyOptionletVolatilitySurfaceBachelier Source #
Arguments
| :: Word | settlementDays |
| -> Calendar | |
| -> BusinessDayConvention | |
| -> DayCounter | |
| -> YoYCapFloorTermPriceSurface | capFloorPrices |
| -> YoYInflationIndex | index |
| -> GenYieldTermStructure y | nominalTermStructure |
| -> Double | slope |
| -> Interpolation | |
| -> IO YoYOptionletVolatilitySurface |
As kInterpolatedYoyOptionletVolatilitySurfaceBlack, but Bachelier (normal model).
yoyCapFloorTermPriceSurface Source #
Arguments
| :: Word | fixingDays |
| -> (Word, TimeUnit) | yyLag |
| -> YoYInflationIndex | |
| -> CPIInterpolationType | |
| -> GenYieldTermStructure y | nominal |
| -> DayCounter | |
| -> Calendar | |
| -> BusinessDayConvention | |
| -> [Double] | cStrikes |
| -> [Double] | fStrikes |
| -> [(Word, TimeUnit)] | cfMaturities |
| -> RealMatrix | cPrice |
| -> RealMatrix | fPrice |
| -> Interpolation2D | |
| -> Interpolation | |
| -> IO YoYCapFloorTermPriceSurface |
Prices YoY cap/floors by cap/floor-surface intersection and put/call parity, deriving an
ATM YoY swap curve as a side effect. Interpolation2D chooses the cap/floor price-grid
interpolator, Interpolation the per-maturity one.
CPI surfaces
cpiCapFloorTermPriceSurface Source #
Arguments
| :: Double | nominal |
| -> Double | baseRate |
| -> (Word, TimeUnit) | observationLag |
| -> Calendar | |
| -> BusinessDayConvention | |
| -> DayCounter | |
| -> ZeroInflationIndex | |
| -> CPIInterpolationType | |
| -> GenYieldTermStructure y | |
| -> [Double] | cStrikes |
| -> [Double] | fStrikes |
| -> [(Word, TimeUnit)] | cfMaturities |
| -> RealMatrix | cPrice |
| -> RealMatrix | fPrice |
| -> Interpolation2D | |
| -> IO CPICapFloorTermPriceSurface |
Prices CPI cap/floors by interpolation and put/call parity off a market strike/maturity
price grid. Interpolation2D chooses the cap/floor price-grid interpolator. cPrice/
fPrice are plain price matrices (rows = strikes, columns = maturities), not quote-linked
like capFloorTermVolSurfaces volatility matrix.
constantCpiVolatility Source #
Arguments
| :: GenQuote q | |
| -> Word | settlementDays |
| -> Calendar | |
| -> BusinessDayConvention | |
| -> DayCounter | |
| -> (Word, TimeUnit) | observationLag |
| -> Frequency | |
| -> Bool | indexIsInterpolated |
| -> IO CPIVolatilitySurface |
Constant CPI (zero-inflation) volatility surface, no maturity/strike dependence -- the only
concrete leaf bound here, mirroring constantYoyOptionletVolatility. No engine or coupon
pricer consumes this in QL 1.43 (see this type's own haddock in QuantLib.Internal.Type), so
it is queryable via cpiVolatility/cpiTotalVariance but not otherwise wired up.
Inspectors
YoY volatility
yoyOptionletVolatility Source #
Arguments
| :: YoYOptionletVolatilitySurface | |
| -> Day | |
| -> Double | strike |
| -> Maybe (Word, TimeUnit) | obsLag |
| -> Bool | extrapolate |
| -> IO Double |
The volatility for a given maturity date and strike, observed with the given observation
lag (or the surface's own lag when Nothing).
yoyOptionletTotalVariance Source #
Arguments
| :: YoYOptionletVolatilitySurface | |
| -> Day | |
| -> Double | strike |
| -> Maybe (Word, TimeUnit) | obsLag |
| -> Bool | extrapolate |
| -> IO Double |
The total integrated variance for a given exercise date and strike -- useful because it
scales out time from the optionlet pricing formulae. As yoyOptionletVolatility, a
Nothing observation lag uses the surface's own.
YoY cap-floor prices
yoyCapFloorBaseDate :: YoYCapFloorTermPriceSurface -> IO Day Source #
The date the surface's own YoY term structure (and hence any YoYOptionletVolatilitySurface
stripped from it) treats as its base -- referenceDate minus the observation lag, rounded to
the containing inflation period's start.
yoyCapFloorAtmYoySwapDateRates :: YoYCapFloorTermPriceSurface -> IO [(Day, Double)] Source #
The ATM YoY swap curve derived from cap/floor-surface intersection, as (date, rate) pairs.
yoyCapFloorAtmYoySwapTimeRates :: YoYCapFloorTermPriceSurface -> IO [(Double, Double)] Source #
The same ATM YoY swap curve as yoyCapFloorAtmYoySwapDateRates, but with maturities as year
fractions from the surface's reference date rather than dates.
yoyCapFloorAtmYoySwapRate Source #
Arguments
| :: YoYCapFloorTermPriceSurface | |
| -> Day | |
| -> Bool | extrapolate |
| -> IO Double |
The ATM YoY swap rate at the given maturity date, from put/call parity on the surface's cap/floor price data.
yoyCapFloorAtmYoyRate Source #
Arguments
| :: YoYCapFloorTermPriceSurface | |
| -> Day | |
| -> Maybe (Word, TimeUnit) | obsLag |
| -> Bool | extrapolate |
| -> IO Double |
The ATM YoY inflation rate at the given maturity date and observation lag (or the surface's
own lag when Nothing), derived from the swap-rate curve above.
yoyCapFloorStrikes :: YoYCapFloorTermPriceSurface -> IO [Double] Source #
The union of cap and floor strikes in the surface's price grid -- the strikes a stripped
YoYOptionletVolatilitySurface (via kInterpolatedYoyOptionletVolatilitySurfaceBlack et al.)
has a bootstrapped vol curve for.
CPI volatility
Arguments
| :: CPIVolatilitySurface | |
| -> Day | |
| -> Double | strike |
| -> Maybe (Word, TimeUnit) | obsLag |
| -> Bool | extrapolate |
| -> IO Double |
The volatility for a given maturity date and strike, observed with the given observation
lag (or the surface's own lag when Nothing).