hasquant
Safe HaskellNone
LanguageHaskell2010

QuantLib.Credit

Description

Portfolio-credit types, baskets, and loss models.

Synopsis

Types

Issuers, pools and baskets

Loss models

Configuration

data Seniority Source #

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).

data RestructuringType Source #

Restructuring clause of a default-probability key (ISDA XR/MR/MM/CR).

data LatentModelIntegrationType Source #

Instances

Instances details
Bounded LatentModelIntegrationType Source # 
Instance details

Defined in QuantLib.Credit

Enum LatentModelIntegrationType Source # 
Instance details

Defined in QuantLib.Credit

Read LatentModelIntegrationType Source # 
Instance details

Defined in QuantLib.Credit

Show LatentModelIntegrationType Source # 
Instance details

Defined in QuantLib.Credit

Eq LatentModelIntegrationType Source # 
Instance details

Defined in QuantLib.Credit

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.

basketProbOverLoss Source #

Arguments

:: TrancheBasket 
-> Day

d

-> Double

lossFraction

-> IO Double 

Probability the tranche loses at least lossFraction of the tranche notional by date d.

basketPercentile Source #

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 #

Arguments

:: DigitalBasket 
-> Day

d

-> Word

iName

-> Word

jName

-> IO Double 

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.

basketNotional :: Basket -> IO Double Source #

Basket total notional at inception, before losses.

basketRemainingNotional Source #

Arguments

:: Basket 
-> Day

d

-> IO Double 

Live (undefaulted) notional remaining at date d. Loss-model-agnostic.

basketRecoveryRate Source #

Arguments

:: Basket 
-> Day

d

-> Word

iName

-> IO Double 

Expected recovery rate of the iName-th pool name (0-based, in basket-construction order), conditional on default by date d. Loss-model-agnostic.