hasquant
Safe HaskellNone
LanguageHaskell2010

QuantLib.Index.Inflation

Synopsis

Types

Inflation index hierarchy

type GenInflationIndex iidx = GenIndex (AnyOf CInflationIndex' iidx) Source #

An InflationIndex or one of its leaves; see the hierarchy under GenIndex.

type InflationIndex = GenInflationIndex CInflationIndex Source #

An Index; see the hierarchy under GenIndex.

type GenZeroInflationIndex zidx = GenInflationIndex (AnyOf CZeroInflationIndex' zidx) Source #

A ZeroInflationIndex or one of its leaves; see the hierarchy under GenIndex.

type ZeroInflationIndex = GenZeroInflationIndex CZeroInflationIndex Source #

An InflationIndex; see the hierarchy under GenIndex.

type GenYoYInflationIndex yidx = GenInflationIndex (AnyOf CYoYInflationIndex' yidx) Source #

A YoYInflationIndex or one of its leaves; see the hierarchy under GenIndex.

type YoYInflationIndex = GenYoYInflationIndex CYoYInflationIndex Source #

An InflationIndex; see the hierarchy under GenIndex.

Regions

data Region Source #

Instances

Instances details
Show Region Source # 
Instance details

Defined in QuantLib.Internal.Type

Eq Region Source # 
Instance details

Defined in QuantLib.Internal.Type

Methods

(==) :: Region -> Region -> Bool #

(/=) :: Region -> Region -> Bool #

Configuration

data ZeroInflationIndexType Source #

data YoYInflationIndexType Source #

Constructors

Hierarchy and regions

region :: RegionType -> IO Region Source #

One of the 6 named geographical/economic regions QuantLib ships (used for the pre-baked named indices, e.g. UKRPI uses UKRegion internally). See 'region'' for an arbitrary custom region.

customRegion :: String -> String -> IO Region Source #

An arbitrary custom region, given its name and ISO code.

Inflation indices

zeroInflationIndex :: ZeroInflationIndexType -> IO ZeroInflationIndex Source #

A named zero inflation index (RPIHICPCPI family). Constructs with no historical fixings and no linked term structure -- add fixings via addFixing.

customZeroInflationIndex Source #

Arguments

:: String

familyName

-> Region 
-> Bool

revised

-> Frequency 
-> (Int, TimeUnit)

availabilityLag

-> Currency 
-> Maybe ZeroInflationTermStructure 
-> IO ZeroInflationIndex 

A custom zero inflation index (arbitrary family nameregioncurrency), with no historical fixings -- add fixings via addFixing.

yoyInflationIndex :: YoYInflationIndexType -> IO YoYInflationIndex Source #

A named quoted year-on-year inflation index.

customYoyInflationIndex Source #

Arguments

:: String

familyName

-> Region 
-> Bool

revised

-> Frequency 
-> (Int, TimeUnit)

availabilityLag

-> Currency 
-> Maybe YoYInflationTermStructure 
-> IO YoYInflationIndex 

A custom quoted year-on-year inflation index (arbitrary family nameregioncurrency); needs its own past fixings added via addFixing. See yoyInflationIndexFromZero for a YoY index defined instead as a ratio of an existing ZeroInflationIndex's fixings.

yoyInflationIndexFromZero :: ZeroInflationIndex -> Maybe YoYInflationTermStructure -> IO YoYInflationIndex Source #

A year-on-year index defined as the ratio of an existing ZeroInflationIndex's fixings; stores no fixings of its own.

Inspectors

fixing :: ZeroInflationIndex -> Day -> IO Double Source #

The (possibly forecast) fixing at the given date; for a date with no linked term structure this returns the stored historical fixing added via addFixing.

yoyFixing :: YoYInflationIndex -> Day -> IO Double Source #

The (possibly forecast) year-on-year fixing at the given date; for a date with no linked term structure this returns the stored historical fixing added via addFixing.

needsForecast :: ZeroInflationIndex -> Day -> IO Bool Source #

Whether fixing at the given date would have to be forecast rather than served from a stored historical fixing -- true once the date falls after the latest period a fixing could plausibly already be published for, given the index's publication lag. Warning It raises an exception if the index was built with a frequency outside Annual..Monthly, which the inflation-period calculation does not handle.

yoyNeedsForecast :: YoYInflationIndex -> Day -> IO Bool Source #

The year-on-year counterpart of needsForecast, for yoyFixing. Warning It raises an exception on an unhandled frequency, as needsForecast does.