| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
QuantLib.TermStructure.Inflation
Synopsis
- type GenZeroInflationTermStructure z = GenTermStructure (AnyOf CZeroInflationTermStructure' z)
- type ZeroInflationTermStructure = GenZeroInflationTermStructure CZeroInflationTermStructure
- type PiecewiseZeroInflationCurve = GenZeroInflationTermStructure CPiecewiseZeroInflationCurve
- type GenYoYInflationTermStructure yoy = GenTermStructure (AnyOf CYoYInflationTermStructure' yoy)
- type YoYInflationTermStructure = GenYoYInflationTermStructure CYoYInflationTermStructure
- type PiecewiseYoYInflationCurve = GenYoYInflationTermStructure CPiecewiseYoYInflationCurve
- data ZeroCouponInflationSwapHelper
- data YearOnYearInflationSwapHelper
- data CPIInterpolationType
- data InflationSwapPeriod
- data Seasonality
- zeroCouponInflationSwapHelper :: GenQuote q -> (Word, TimeUnit) -> InflationSwapPeriod -> Calendar -> BusinessDayConvention -> DayCounter -> GenZeroInflationIndex zidx -> CPIInterpolationType -> PillarChoice -> Maybe Day -> IO ZeroCouponInflationSwapHelper
- yearOnYearInflationSwapHelper :: GenQuote q -> (Word, TimeUnit) -> InflationSwapPeriod -> Calendar -> BusinessDayConvention -> DayCounter -> GenYoYInflationIndex yidx -> CPIInterpolationType -> GenYieldTermStructure y -> PillarChoice -> Maybe Day -> IO YearOnYearInflationSwapHelper
- cpiBondHelper :: GenQuote q -> Word -> Double -> Double -> (Word, TimeUnit) -> GenZeroInflationIndex zidx -> CPIInterpolationType -> Schedule -> NonEmpty Double -> DayCounter -> BusinessDayConvention -> Maybe Day -> Calendar -> IO BondHelper
- piecewiseZeroInflationCurve :: Day -> Day -> Frequency -> DayCounter -> NonEmpty ZeroCouponInflationSwapHelper -> Maybe Seasonality -> Interpolation -> IO PiecewiseZeroInflationCurve
- piecewiseYoyInflationCurve :: Day -> Day -> Double -> Frequency -> DayCounter -> NonEmpty YearOnYearInflationSwapHelper -> Maybe Seasonality -> Interpolation -> IO PiecewiseYoYInflationCurve
- interpolatedYoyInflationCurve :: Day -> NonEmpty (Day, Double) -> Frequency -> DayCounter -> Maybe Seasonality -> Interpolation -> IO YoYInflationTermStructure
- interpolatedZeroInflationCurve :: Day -> NonEmpty (Day, Double) -> Frequency -> DayCounter -> Maybe Seasonality -> Interpolation -> IO ZeroInflationTermStructure
- asZeroInflationTermStructure :: GenZeroInflationTermStructure z -> IO ZeroInflationTermStructure
- asYoyInflationTermStructure :: GenYoYInflationTermStructure yoy -> IO YoYInflationTermStructure
- class HasHelperUnderlying h where
- type HelperUnderlying h
- helperInstrument :: h -> IO (HelperUnderlying h)
- zeroRate :: GenZeroInflationTermStructure z -> Day -> Bool -> IO Double
- yoyRate :: GenYoYInflationTermStructure yoy -> Day -> Bool -> IO Double
- class HasImpliedQuoteOn helper curve where
- impliedQuoteOn :: helper -> curve -> IO Double
- class HasNodes c where
- bootstrappedNodes :: c -> IO [(Day, Double)]
Types
type GenZeroInflationTermStructure z = GenTermStructure (AnyOf CZeroInflationTermStructure' z) Source #
A ZeroInflationTermStructure or one of its leaves; see the hierarchy under GenTermStructure.
type ZeroInflationTermStructure = GenZeroInflationTermStructure CZeroInflationTermStructure Source #
A TermStructure; see the hierarchy under GenTermStructure.
type PiecewiseZeroInflationCurve = GenZeroInflationTermStructure CPiecewiseZeroInflationCurve Source #
A ZeroInflationTermStructure bootstrapped from swap helpers, whose nodes can be read; see the
hierarchy under GenTermStructure.
type GenYoYInflationTermStructure yoy = GenTermStructure (AnyOf CYoYInflationTermStructure' yoy) Source #
A YoYInflationTermStructure or one of its leaves; see the hierarchy under GenTermStructure.
type YoYInflationTermStructure = GenYoYInflationTermStructure CYoYInflationTermStructure Source #
A TermStructure; see the hierarchy under GenTermStructure.
type PiecewiseYoYInflationCurve = GenYoYInflationTermStructure CPiecewiseYoYInflationCurve Source #
A YoYInflationTermStructure bootstrapped from swap helpers, whose nodes can be read; see the
hierarchy under GenTermStructure.
data ZeroCouponInflationSwapHelper Source #
Instances
| HasHelperUnderlying ZeroCouponInflationSwapHelper Source # | |||||
Defined in QuantLib.TermStructure Associated Types
| |||||
| HasImpliedQuoteOn ZeroCouponInflationSwapHelper (GenZeroInflationTermStructure z) Source # | |||||
Defined in QuantLib.TermStructure.Inflation Methods impliedQuoteOn :: ZeroCouponInflationSwapHelper -> GenZeroInflationTermStructure z -> IO Double Source # | |||||
| type HelperUnderlying ZeroCouponInflationSwapHelper Source # | |||||
data YearOnYearInflationSwapHelper Source #
Instances
| HasHelperUnderlying YearOnYearInflationSwapHelper Source # | |||||
Defined in QuantLib.TermStructure Associated Types
| |||||
| HasImpliedQuoteOn YearOnYearInflationSwapHelper (GenYoYInflationTermStructure yoy) Source # | |||||
Defined in QuantLib.TermStructure.Inflation Methods impliedQuoteOn :: YearOnYearInflationSwapHelper -> GenYoYInflationTermStructure yoy -> IO Double Source # | |||||
| type HelperUnderlying YearOnYearInflationSwapHelper Source # | |||||
data CPIInterpolationType Source #
Instances
data InflationSwapPeriod Source #
Which dates an inflation swap helper's swap runs between. InflationSwapToMaturity starts on
the evaluation date and moves with it; InflationSwapBetweenDates is fixed. The fixed form also
takes its observation-interpolation weight from the start date rather than the maturity.
Constructors
| InflationSwapToMaturity !Day | maturity |
| InflationSwapBetweenDates | |
Seasonality
data Seasonality Source #
Multiplicative price seasonality applied by an inflation curve's zero and year-on-year rates. Factors repeat every whole multiple of a year and are normalized to the curve's base date; multi-year factors inconsistent at whole years around that date make construction throw.
Constructors
| MultiplicativePriceSeasonality !Day !Frequency ![Double] | seasonalityBaseDate, frequency, factors |
| KerkhofSeasonality !Day ![Double] | seasonalityBaseDate, monthly factors |
Constructors
Helpers
zeroCouponInflationSwapHelper Source #
Arguments
| :: GenQuote q | quote |
| -> (Word, TimeUnit) | swapObsLag |
| -> InflationSwapPeriod | |
| -> Calendar | |
| -> BusinessDayConvention | paymentConvention |
| -> DayCounter | |
| -> GenZeroInflationIndex zidx | |
| -> CPIInterpolationType | observationInterpolation |
| -> PillarChoice | pillar |
| -> Maybe Day | customPillarDate |
| -> IO ZeroCouponInflationSwapHelper |
Bootstrap helper for a zero-coupon inflation swap, at the given observation lag and period.
yearOnYearInflationSwapHelper Source #
Arguments
| :: GenQuote q | quote |
| -> (Word, TimeUnit) | swapObsLag |
| -> InflationSwapPeriod | |
| -> Calendar | |
| -> BusinessDayConvention | paymentConvention |
| -> DayCounter | |
| -> GenYoYInflationIndex yidx | |
| -> CPIInterpolationType | observationInterpolation |
| -> GenYieldTermStructure y | nominalTermStructure |
| -> PillarChoice | pillar |
| -> Maybe Day | customPillarDate |
| -> IO YearOnYearInflationSwapHelper |
Bootstrap helper for a year-on-year inflation swap. Unlike zeroCouponInflationSwapHelper,
also needs the nominal discount curve (the YoY swap's fixed/floating legs discount off it).
Arguments
| :: GenQuote q | |
| -> Word | settlementDays |
| -> Double | faceAmount |
| -> Double | baseCPI |
| -> (Word, TimeUnit) | observationLag |
| -> GenZeroInflationIndex zidx | |
| -> CPIInterpolationType | observationInterpolation |
| -> Schedule | |
| -> NonEmpty Double | coupons |
| -> DayCounter | accrualDayCounter |
| -> BusinessDayConvention | paymentConvention |
| -> Maybe Day | issueDate |
| -> Calendar | paymentCalendar |
| -> IO BondHelper |
Bootstrap helper for a CPIBond -- a CPIBondHelper, which is a
plain BondHelper subclass with no extra methods, so it's returned as the generic
BondHelper type (same shape as fixedRateBondHelper).
Curves
piecewiseZeroInflationCurve Source #
Arguments
| :: Day | referenceDate |
| -> Day | baseDate |
| -> Frequency | |
| -> DayCounter | |
| -> NonEmpty ZeroCouponInflationSwapHelper | |
| -> Maybe Seasonality | |
| -> Interpolation | |
| -> IO PiecewiseZeroInflationCurve |
Bootstraps a zero-inflation term structure piecewise from a set of helpers, interpolating
between the bootstrapped nodes with the given Interpolation.
piecewiseYoyInflationCurve Source #
Arguments
| :: Day | referenceDate |
| -> Day | baseDate |
| -> Double | baseYoYRate |
| -> Frequency | |
| -> DayCounter | |
| -> NonEmpty YearOnYearInflationSwapHelper | |
| -> Maybe Seasonality | |
| -> Interpolation | |
| -> IO PiecewiseYoYInflationCurve |
Bootstraps a year-on-year inflation term structure piecewise from a set of helpers,
interpolating between the bootstrapped nodes with the given Interpolation.
interpolatedYoyInflationCurve Source #
Arguments
| :: Day | referenceDate |
| -> NonEmpty (Day, Double) | dates, rates |
| -> Frequency | |
| -> DayCounter | |
| -> Maybe Seasonality | |
| -> Interpolation | |
| -> IO YoYInflationTermStructure |
A YoY-inflation curve interpolating directly between given (date, rate) nodes, unlike
piecewiseYoyInflationCurve bootstrap from swap helpers -- useful when the rates are
already known market YoY levels rather than swap quotes to calibrate against. The first
node is the curve's own base date/rate.
interpolatedZeroInflationCurve Source #
Arguments
| :: Day | referenceDate |
| -> NonEmpty (Day, Double) | dates, rates |
| -> Frequency | |
| -> DayCounter | |
| -> Maybe Seasonality | |
| -> Interpolation | |
| -> IO ZeroInflationTermStructure |
A zero-coupon inflation curve interpolating directly between given (date, rate) nodes. The first node is the curve's base date.
Conversions
asZeroInflationTermStructure :: GenZeroInflationTermStructure z -> IO ZeroInflationTermStructure Source #
asYoyInflationTermStructure :: GenYoYInflationTermStructure yoy -> IO YoYInflationTermStructure Source #
Inspectors
class HasHelperUnderlying h where Source #
Bootstrap and calibration helpers that build and hold the instrument whose market quote they match. The class lives here, in the term-structure root module, because its instances span QuantLib.TermStructure.Yield, ".Inflation" and QuantLib.Model, and an instance must share a module with its class to stay non-orphan.
Associated Types
type HelperUnderlying h Source #
Methods
helperInstrument :: h -> IO (HelperUnderlying h) Source #
The instrument the helper prices. For helpers that build it internally --
fixedRateBondHelper and
cpiBondHelper among them -- this is the only way to reach it.
Instances
Arguments
| :: GenZeroInflationTermStructure z | |
| -> Day | |
| -> Bool | extrapolate |
| -> IO Double |
Zero-coupon inflation rate implied by the curve.
Arguments
| :: GenYoYInflationTermStructure yoy | |
| -> Day | |
| -> Bool | extrapolate |
| -> IO Double |
Year-on-year inflation rate implied by the curve.
class HasImpliedQuoteOn helper curve where Source #
Inflation swap helpers paired with the only curve family each can reprice on.
Methods
impliedQuoteOn :: helper -> curve -> IO Double Source #
The swap rate that would make the helper reprice exactly on the given curve, bootstrapped from it or not.
Instances
| HasImpliedQuoteOn YearOnYearInflationSwapHelper (GenYoYInflationTermStructure yoy) Source # | |
Defined in QuantLib.TermStructure.Inflation Methods impliedQuoteOn :: YearOnYearInflationSwapHelper -> GenYoYInflationTermStructure yoy -> IO Double Source # | |
| HasImpliedQuoteOn ZeroCouponInflationSwapHelper (GenZeroInflationTermStructure z) Source # | |
Defined in QuantLib.TermStructure.Inflation Methods impliedQuoteOn :: ZeroCouponInflationSwapHelper -> GenZeroInflationTermStructure z -> IO Double Source # | |
class HasNodes c where Source #
Bootstrapped curve leaves that retain their native nodes. The class lives in this root module
for the same reason as HasHelperUnderlying: its instances span the topical curve modules.
Methods
bootstrappedNodes :: c -> IO [(Day, Double)] Source #
The curve's (date, value) nodes; reading them runs the bootstrap. The first node is the
reference date (inflation curves: the base date), the rest are helper pillars. Each value is
what the curve interpolates: the trait's quantity for yield and default curves, a
discount-factor spread for piecewiseSpreadYieldCurve, and
the rate before seasonality for inflation curves. Jump factors are applied separately and
are not part of the nodes.
An interpolated curve of the same kind on these nodes, with the original day counter, interpolation, jumps and seasonality, reproduces the bootstrapped curve. The exception is a local bootstrap, whose convex-monotone shape also depends on state the nodes do not carry.
Instances
| HasNodes PiecewiseDefaultCurve Source # | |
Defined in QuantLib.TermStructure Methods bootstrappedNodes :: PiecewiseDefaultCurve -> IO [(Day, Double)] Source # | |
| HasNodes PiecewiseYieldCurve Source # | |
Defined in QuantLib.TermStructure Methods bootstrappedNodes :: PiecewiseYieldCurve -> IO [(Day, Double)] Source # | |
| HasNodes PiecewiseYoYInflationCurve Source # | |
Defined in QuantLib.TermStructure Methods bootstrappedNodes :: PiecewiseYoYInflationCurve -> IO [(Day, Double)] Source # | |
| HasNodes PiecewiseZeroInflationCurve Source # | |
Defined in QuantLib.TermStructure Methods bootstrappedNodes :: PiecewiseZeroInflationCurve -> IO [(Day, Double)] Source # | |