| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
QuantLib.Credit
Description
Portfolio-credit types, baskets, and loss models.
Synopsis
- data DefaultProbKey
- data Issuer
- data Pool
- data Basket
- data TrancheBasket
- data DigitalBasket
- data DefaultLossModel
- data DigitalLossModel
- data Seniority
- data RestructuringType
- data LatentModelIntegrationType
- northAmericaCorpDefaultKey :: Currency -> Seniority -> (Int, TimeUnit) -> Double -> RestructuringType -> IO DefaultProbKey
- issuer :: NonEmpty (DefaultProbKey, DefaultProbabilityTermStructure) -> IO Issuer
- pool :: NonEmpty (String, Issuer, DefaultProbKey) -> IO Pool
- basket :: Day -> NonEmpty (String, Double) -> Pool -> Double -> Double -> Claim -> DefaultLossModel -> IO TrancheBasket
- trancheBasketAsBasket :: TrancheBasket -> Basket
- digitalBasket :: Day -> NonEmpty (String, Double) -> Pool -> Double -> Double -> Claim -> DigitalLossModel -> IO DigitalBasket
- digitalBasketAsBasket :: DigitalBasket -> Basket
- gaussianLhpLossModel :: GenQuote q -> NonEmpty Double -> IO DefaultLossModel
- constantLossModel :: GenQuote q -> NonEmpty Double -> LatentModelIntegrationType -> [Int] -> IO DigitalLossModel
- basketExpectedTrancheLoss :: TrancheBasket -> Day -> IO Double
- basketProbOverLoss :: TrancheBasket -> Day -> Double -> IO Double
- basketPercentile :: TrancheBasket -> Day -> Double -> IO Double
- basketExpectedShortfall :: TrancheBasket -> Day -> Double -> IO Double
- basketDefaultCorrelation :: DigitalBasket -> Day -> Word -> Word -> IO Double
- basketProbAtLeastNEvents :: DigitalBasket -> Word -> Day -> IO Double
- basketNotional :: Basket -> IO Double
- basketRemainingNotional :: Basket -> Day -> IO Double
- basketRecoveryRate :: Basket -> Day -> Word -> IO Double
Types
Issuers, pools and baskets
data DefaultProbKey Source #
data TrancheBasket Source #
data DigitalBasket Source #
Loss models
data DefaultLossModel Source #
data DigitalLossModel Source #
Configuration
Seniority of a bond; also used as the ISDA tier/seniority for CDS conventional spreads.
Numerical-integration scheme used by a LatentModel-based copula loss
model (e.g. the gaussian/student constant-loss dispatcher bound alongside NthToDefault).
Constructors
| SecDom | |
| SeniorSec | |
| SnrFor | |
| SeniorUnSec | |
| SubLT2 | |
| SubLoweTier2 | |
| JrSubT2 | |
| SubUpperTier2 | |
| PrefT1 | |
| SubTier1 | |
| NoSeniority |
Instances
| Bounded Seniority Source # | |
| Enum Seniority Source # | |
Defined in QuantLib.Credit Methods succ :: Seniority -> Seniority # pred :: Seniority -> Seniority # fromEnum :: Seniority -> Int # enumFrom :: Seniority -> [Seniority] # enumFromThen :: Seniority -> Seniority -> [Seniority] # enumFromTo :: Seniority -> Seniority -> [Seniority] # enumFromThenTo :: Seniority -> Seniority -> Seniority -> [Seniority] # | |
| Read Seniority Source # | |
| Show Seniority Source # | |
| Eq Seniority Source # | |
data RestructuringType Source #
Restructuring clause of a default-probability key (ISDA XR/MR/MM/CR).
Constructors
| NoRestructuring | |
| XR | |
| ModifiedRestructuring | |
| MR | |
| ModifiedModifiedRestructuring | |
| MM | |
| FullRestructuring | |
| CR | |
| AnyRestructuring |
Instances
data LatentModelIntegrationType Source #
Constructors
| GaussianQuadrature | |
| Trapezoid |
Instances
Constructors
northAmericaCorpDefaultKey Source #
Arguments
| :: Currency | currency |
| -> Seniority | seniority |
| -> (Int, TimeUnit) | graceFailureToPay |
| -> Double | amountFailure |
| -> RestructuringType | restructuringType |
| -> IO DefaultProbKey |
ISDA standard default contractual key for corporate US debt. restructuringType may be
NoRestructuring to disable restructuring as a trigger.
issuer :: NonEmpty (DefaultProbKey, DefaultProbabilityTermStructure) -> IO Issuer Source #
An issuer's default-probability term structures, keyed by contract terms.
pool :: NonEmpty (String, Issuer, DefaultProbKey) -> IO Pool Source #
A named collection of issuers and their default-probability keys.
basket :: Day -> NonEmpty (String, Double) -> Pool -> Double -> Double -> Claim -> DefaultLossModel -> IO TrancheBasket Source #
A tranched basket with a tranche-loss model; usable for CDO pricing.
digitalBasket :: Day -> NonEmpty (String, Double) -> Pool -> Double -> Double -> Claim -> DigitalLossModel -> IO DigitalBasket Source #
A digital-loss basket for nth-to-default pricing.
gaussianLhpLossModel :: GenQuote q -> NonEmpty Double -> IO DefaultLossModel Source #
One-factor Gaussian-copula LHP loss model. recoveries follow basket-name order.
constantLossModel :: GenQuote q -> NonEmpty Double -> LatentModelIntegrationType -> [Int] -> IO DigitalLossModel Source #
One-factor Gaussian- or Student-T-copula model for digital-loss baskets.
[] selects Gaussian; tOrders selects Student-T degrees of freedom.
Inspectors
basketExpectedTrancheLoss Source #
Arguments
| :: TrancheBasket | |
| -> Day | d |
| -> IO Double |
Expected tranche loss on date d; requires a tranche-loss model.
Arguments
| :: TrancheBasket | |
| -> Day | d |
| -> Double | lossFraction |
| -> IO Double |
Probability the tranche loses at least lossFraction of the tranche notional by date d.
Arguments
| :: TrancheBasket | |
| -> Day | d |
| -> Double | prob |
| -> IO Double |
Tranche loss fraction at the given percentile of the loss distribution on date d (VaR).
basketExpectedShortfall Source #
Arguments
| :: TrancheBasket | |
| -> Day | d |
| -> Double | prob |
| -> IO Double |
Expected tranche loss given loss exceeds the given percentile on date d.
basketDefaultCorrelation Source #
Pearson default-probability correlation between pool names iName and jName (0-based) by
date d.
basketProbAtLeastNEvents Source #
Arguments
| :: DigitalBasket | |
| -> Word | n |
| -> Day | d |
| -> IO Double |
Probability of at least n defaults in the basket by date d.
basketRemainingNotional Source #
Live (undefaulted) notional remaining at date d. Loss-model-agnostic.