hasquant
Safe HaskellNone
LanguageHaskell2010

QuantLib.TermStructure.Credit

Synopsis

Types

Curves and helpers

type GenDefaultProbabilityTermStructure d = GenTermStructure (AnyOf CDefaultProbabilityTermStructure' d) Source #

A DefaultProbabilityTermStructure or one of its leaves; see the hierarchy under GenTermStructure.

type DefaultProbabilityTermStructure = GenDefaultProbabilityTermStructure CDefaultProbabilityTermStructure Source #

A TermStructure; see the hierarchy under GenTermStructure.

Coordinates

data Reference Source #

A term-structure reference point. ReferenceDate stays fixed for the object's lifetime; SettlementDays follows the global evaluation date using the supplied calendar.

Instances

Instances details
Show Reference Source # 
Instance details

Defined in QuantLib.TermStructure

Eq Reference Source # 
Instance details

Defined in QuantLib.TermStructure

data TermPoint Source #

A date or year-fraction coordinate measured from a term structure's reference date.

Constructors

DatePoint !Day 
TimePoint !Double 

Instances

Instances details
Show TermPoint Source # 
Instance details

Defined in QuantLib.TermStructure

Eq TermPoint Source # 
Instance details

Defined in QuantLib.TermStructure

data TermInterval Source #

A same-representation interval. Keeping both endpoints in one constructor prevents mixed date/time intervals that upstream does not accept.

Instances

Instances details
Show TermInterval Source # 
Instance details

Defined in QuantLib.TermStructure

Eq TermInterval Source # 
Instance details

Defined in QuantLib.TermStructure

Bootstrap configuration

data IterativeBootstrapOpts Source #

Every constructor parameter of QuantLib's curve-generic IterativeBootstrap. The first three fields are Maybe because Nothing preserves QuantLib's Null<Real>() sentinel, which selects a suitable value for each curve pillar.

Constructors

Flat and spreaded curves

flatHazardRate :: Reference -> GenQuote q -> DayCounter -> IO DefaultProbabilityTermStructure Source #

Flat hazard-rate curve with either a fixed or evaluation-date-relative reference point.

spreadedHazardRateCurve :: GenDefaultProbabilityTermStructure d -> GenQuote q -> IO DefaultProbabilityTermStructure Source #

a curve whose survival probability is another curve's, multiplied by a spread factor

Helpers and bootstrapped curves

spreadCdsHelper Source #

Arguments

:: GenQuote q

runningSpread

-> (Word, TimeUnit)

tenor

-> Int

settlementDays

-> Calendar 
-> Frequency 
-> BusinessDayConvention 
-> DateGenerationRule 
-> DayCounter 
-> Double 
-> GenYieldTermStructure y

discountCurve

-> Bool

settlesAccrual

-> Bool

paysAtDefaultTime

-> Maybe Day

startDate

-> DayCounter

lastPeriodDayCounter

-> Bool

rebatesAccrual

-> PricingModel

model

-> IO DefaultProbabilityHelper 

bootstrap helper for a CDS quoted by running spread

upfrontCdsHelper Source #

Arguments

:: GenQuote q

upfront

-> Double

runningSpread

-> (Word, TimeUnit)

tenor

-> Int

settlementDays

-> Calendar 
-> Frequency 
-> BusinessDayConvention 
-> DateGenerationRule 
-> DayCounter 
-> Double

recoveryDate

-> GenYieldTermStructure y

discountCurve

-> Word

upfrontSettlementDays

-> Bool 
-> Bool

paysAtDefaultTime

-> Maybe Day

startDate

-> DayCounter

lastPeriodDayCounter

-> Bool

rebatesAccrual

-> PricingModel

model

-> IO DefaultProbabilityHelper 

the upfront must be quoted in fractional units.

interpolatedHazardRateCurve Source #

Arguments

:: NonEmpty (Day, Double) 
-> DayCounter 
-> Calendar 
-> [(Day, GenQuote q)]

jumps

-> Interpolation 
-> Bool

extrapolate past the curve's max date

-> IO DefaultProbabilityTermStructure 

interpolatedAffineHazardRateCurve Source #

Arguments

:: NonEmpty (Day, Double) 
-> DayCounter 
-> GenOneFactorAffineModel om 
-> Calendar 
-> [(Day, GenQuote q)]

jumps

-> Interpolation 
-> Bool

extrapolate past the curve's max date

-> IO AffineHazardRateCurve 

Hazard-rate curve interpolated deterministically between nodes, combined with a one-factor affine short-rate model's stochastic discount mechanics -- see 'qlexperimentalcredit/interpolatedaffinehazardratecurve.hpp'.

piecewiseDefaultCurve Source #

Arguments

:: Reference 
-> NonEmpty DefaultProbabilityHelper

instruments

-> DayCounter

dayCounter

-> [(Day, GenQuote q)]

jumps paired with their dates

-> ProbabilityTrait

bootstrap trait

-> Interpolation

interpolator

-> IterativeBootstrapOpts

bootstrap settings

-> Bool

extrapolate past the curve's max date

-> IO DefaultProbabilityTermStructure 

Default-probability term structure bootstrapped from CDS/default helpers with either a fixed or evaluation-date-relative reference point and complete iterative-bootstrap settings.

Inspectors

defaultProbability :: GenDefaultProbabilityTermStructure d -> TermPoint -> Bool -> IO Double Source #

Default probability from the reference point to a date or year fraction.

hazardRate :: GenDefaultProbabilityTermStructure d -> TermPoint -> Bool -> IO Double Source #

Hazard rate at a date or year fraction, with annual frequency and continuous compounding.

survivalProbability :: GenDefaultProbabilityTermStructure d -> TermPoint -> Bool -> IO Double Source #

Survival probability from the reference point to a date or year fraction.

defaultDensity :: GenDefaultProbabilityTermStructure d -> TermPoint -> Bool -> IO Double Source #

Default density at a date or year fraction.

defaultProbabilityBetween :: GenDefaultProbabilityTermStructure d -> TermInterval -> Bool -> IO Double Source #

Default probability over a same-representation date or year-fraction interval.

conditionalSurvivalProbability Source #

Arguments

:: AffineHazardRateCurve 
-> TermInterval 
-> Double

yVal

-> Bool 
-> IO Double 

Probability of survival to the interval's later point, conditional on survival to its earlier point and on the stochastic hazard-rate component realizing yVal there -- see 'qlexperimentalcredit/onefactoraffinesurvival.hpp'.

impliedQuote :: DefaultProbabilityHelper -> IO Double Source #

The fair running-spread/upfront quote implied by the helper's current market data and pricing engine -- the value that would make the quoted instrument re-price at par. Requires the helper to have already been used to bootstrap a curve (throws otherwise, per upstream).