Crate loan_ec

source ·
Expand description

Economic capital for a loan portfolio. Based on https://github.com/phillyfan1138/CreditRiskExtensions/blob/master/StahlMultiVariatePaper.pdf.

Structs

Holds the attributes for the entire portfolio. The “cf” element holds the characteristic function for the portfolio. The “el_vec” element holds the expected value (first moment) vector of length num_w for the portfolio. The “var_vec” element holds the second moment vector of length num_w for the portfolio p_j E[l^2]w_j. The “num_w” element holds the number of systemic random variables. The “lambda” element holds the total liquidity risk for the portfolio (derived from each loan).
Struct representing loan attributes

Functions

Returns the expectation of a portfolio with liquidity risk
Returns a function incorporating liquidity risk to the characteristic function. This function makes lambda negative, since the probability of lambda occurring is -qX since X is negative.
Returns a function which is the characteristic exponent for a given loan. The “lgd_cf” argument is the characteristic function for a given loan’s LGD. The “liquidity_cf” argument is the liquidity function typically instantiated from “get_liquidity_risk_fn”.
Returns risk contribution for a given loan
Returns the variance of a portfolio with liquidity risk