hasquant
Safe HaskellNone
LanguageHaskell2010

QuantLib.TermStructure.InflationVolatility

Synopsis

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 (kInterpolatedYoyOptionletVolatilitySurface 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.

Pricing model

data YoyOptionletModel Source #

Pricing model for stripping YoY cap/floor price quotes.

Price-surface dating

data YoyPriceSurfaceStart Source #

Constructors

MovingStart

QuantLib's moving reference date and swap helpers, following the evaluation date.

BookedAtEvaluationDate

Reference date fixed at the construction evaluation date; the derived ATM curve uses fixed-start swap helpers with the same native pillars, so a later evaluation date cannot rebuild a swap after its maturity. Rebuild the surface to value it on another date.

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 kInterpolatedYoyOptionletVolatilitySurface for the market-quote-bootstrapped alternative.

kInterpolatedYoyOptionletVolatilitySurface Source #

Arguments

:: YoyOptionletModel 
-> Word

Business-day settlement lag of the volatility surface.

-> Calendar 
-> BusinessDayConvention 
-> DayCounter 
-> YoYCapFloorTermPriceSurface

Quoted cap/floor term prices to strip.

-> GenYoYInflationIndex yidx

YoY index used to price the stripping helpers.

-> GenYieldTermStructure y

Nominal discount curve used to price the stripping helpers.

-> Double

Initial relative caplet-volatility slope per year.

-> Maybe (Double, Double)

Optional (lower, upper) initial annual volatility bounds, per square root year: log-rate units for Black, log(1+rate) for unit-displaced Black, absolute decimal-rate units for Bachelier.

-> Interpolation 
-> IO YoYOptionletVolatilitySurface 

Strip a native per-strike volatility curve and interpolate across strikes. The optional initial volatility bracket replaces QuantLib's fixed 1e-5 to 0.08 bounds; Nothing uses the unmodified native stripper. An explicit bracket uses its protected native objective, Brent solver (accuracy 1e-7), helpers and piecewise bootstrap, changing only those bounds. Bounds must be finite, positive and strictly ordered. The slope is the native relative initial caplet-volatility slope outside reliable short-end prices. LogCubic is unsupported because the native stripper default-constructs its interpolator. The index and nominal curve price the null-vol engine the stripper solves against.

yoyCapFloorTermPriceSurface Source #

Arguments

:: YoyPriceSurfaceStart

Moving dates, or a grid booked at the evaluation date.

-> Word

fixingDays

-> (Word, TimeUnit)

yyLag

-> GenYoYInflationIndex yidx 
-> 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.

See YoyPriceSurfaceStart for the moving and booked dating choices. The intersection, parity, interpolation and bootstrapping calculations remain QuantLib's.

CPI surfaces

cpiCapFloorTermPriceSurface Source #

Arguments

:: Double

nominal

-> Double

baseRate

-> (Word, TimeUnit)

observationLag

-> Calendar 
-> BusinessDayConvention 
-> DayCounter 
-> GenZeroInflationIndex zidx 
-> 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 kInterpolatedYoyOptionletVolatilitySurface) has a bootstrapped vol curve for.

CPI volatility

cpiVolatility Source #

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).

cpiTotalVariance Source #

Arguments

:: CPIVolatilitySurface 
-> Day 
-> Double

strike

-> Maybe (Word, TimeUnit)

obsLag

-> Bool

extrapolate

-> IO Double 

The total integrated variance for a given exercise date and strike. As cpiVolatility, a Nothing observation lag uses the surface's own.