| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
QuantLib.TermStructure.Credit
Synopsis
- type GenDefaultProbabilityTermStructure d = GenTermStructure (AnyOf CDefaultProbabilityTermStructure' d)
- type DefaultProbabilityTermStructure = GenDefaultProbabilityTermStructure CDefaultProbabilityTermStructure
- type AffineHazardRateCurve = GenDefaultProbabilityTermStructure CAffineHazardRateCurve
- data DefaultProbabilityHelper
- data Reference
- data TermPoint
- data TermInterval
- = DateInterval !Day !Day
- | TimeInterval !Double !Double
- data ProbabilityTrait
- data IterativeBootstrapOpts = IterativeBootstrapOpts {}
- factorSpreadedHazardRateCurve :: GenDefaultProbabilityTermStructure d -> GenQuote q -> IO DefaultProbabilityTermStructure
- flatHazardRate :: Reference -> GenQuote q -> DayCounter -> IO DefaultProbabilityTermStructure
- spreadedHazardRateCurve :: GenDefaultProbabilityTermStructure d -> GenQuote q -> IO DefaultProbabilityTermStructure
- spreadCdsHelper :: GenQuote q -> (Word, TimeUnit) -> Int -> Calendar -> Frequency -> BusinessDayConvention -> DateGenerationRule -> DayCounter -> Double -> GenYieldTermStructure y -> Bool -> Bool -> Maybe Day -> DayCounter -> Bool -> PricingModel -> IO DefaultProbabilityHelper
- upfrontCdsHelper :: GenQuote q -> Double -> (Word, TimeUnit) -> Int -> Calendar -> Frequency -> BusinessDayConvention -> DateGenerationRule -> DayCounter -> Double -> GenYieldTermStructure y -> Word -> Bool -> Bool -> Maybe Day -> DayCounter -> Bool -> PricingModel -> IO DefaultProbabilityHelper
- interpolatedDefaultDensityCurve :: NonEmpty (Day, Double) -> DayCounter -> Calendar -> [(Day, GenQuote q)] -> Interpolation -> Bool -> IO DefaultProbabilityTermStructure
- interpolatedHazardRateCurve :: NonEmpty (Day, Double) -> DayCounter -> Calendar -> [(Day, GenQuote q)] -> Interpolation -> Bool -> IO DefaultProbabilityTermStructure
- interpolatedAffineHazardRateCurve :: NonEmpty (Day, Double) -> DayCounter -> GenOneFactorAffineModel om -> Calendar -> [(Day, GenQuote q)] -> Interpolation -> Bool -> IO AffineHazardRateCurve
- interpolatedSurvivalProbabilityCurve :: NonEmpty (Day, Double) -> DayCounter -> Calendar -> [(Day, GenQuote q)] -> Interpolation -> Bool -> IO DefaultProbabilityTermStructure
- defaultIterativeBootstrapOpts :: IterativeBootstrapOpts
- piecewiseDefaultCurve :: Reference -> NonEmpty DefaultProbabilityHelper -> DayCounter -> [(Day, GenQuote q)] -> ProbabilityTrait -> Interpolation -> IterativeBootstrapOpts -> Bool -> IO DefaultProbabilityTermStructure
- defaultProbability :: GenDefaultProbabilityTermStructure d -> TermPoint -> Bool -> IO Double
- hazardRate :: GenDefaultProbabilityTermStructure d -> TermPoint -> Bool -> IO Double
- survivalProbability :: GenDefaultProbabilityTermStructure d -> TermPoint -> Bool -> IO Double
- defaultDensity :: GenDefaultProbabilityTermStructure d -> TermPoint -> Bool -> IO Double
- defaultProbabilityBetween :: GenDefaultProbabilityTermStructure d -> TermInterval -> Bool -> IO Double
- conditionalSurvivalProbability :: AffineHazardRateCurve -> TermInterval -> Double -> Bool -> IO Double
- impliedQuote :: DefaultProbabilityHelper -> IO Double
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.
type AffineHazardRateCurve = GenDefaultProbabilityTermStructure CAffineHazardRateCurve Source #
A DefaultProbabilityTermStructure; see the hierarchy under GenTermStructure.
Coordinates
A term-structure reference point. ReferenceDate stays fixed for the object's lifetime;
SettlementDays follows the global evaluation date using the supplied calendar.
Constructors
| ReferenceDate !Day | |
| SettlementDays !Word !Calendar |
A date or year-fraction coordinate measured from a term structure's reference date.
data TermInterval Source #
A same-representation interval. Keeping both endpoints in one constructor prevents mixed date/time intervals that upstream does not accept.
Constructors
| DateInterval !Day !Day | |
| TimeInterval !Double !Double |
Instances
| Show TermInterval Source # | |
Defined in QuantLib.TermStructure Methods showsPrec :: Int -> TermInterval -> ShowS # show :: TermInterval -> String # showList :: [TermInterval] -> ShowS # | |
| Eq TermInterval Source # | |
Defined in QuantLib.TermStructure | |
Bootstrap configuration
data ProbabilityTrait Source #
Constructors
| SurvivalProbability | |
| HazardRate | |
| DefaultDensity |
Instances
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
| IterativeBootstrapOpts | |
Fields
| |
Constructors
Flat and spreaded curves
factorSpreadedHazardRateCurve :: GenDefaultProbabilityTermStructure d -> GenQuote q -> IO DefaultProbabilityTermStructure Source #
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
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
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.
interpolatedDefaultDensityCurve Source #
Arguments
| :: NonEmpty (Day, Double) | |
| -> DayCounter | |
| -> Calendar | |
| -> [(Day, GenQuote q)] | jumps |
| -> Interpolation | |
| -> Bool | |
| -> IO DefaultProbabilityTermStructure |
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'.
interpolatedSurvivalProbabilityCurve Source #
Arguments
| :: NonEmpty (Day, Double) | |
| -> DayCounter | |
| -> Calendar | |
| -> [(Day, GenQuote q)] | jumps |
| -> Interpolation | |
| -> Bool | |
| -> IO DefaultProbabilityTermStructure |
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).