model_clo_insight.engines.pool_builders module¶
Module for the methods which build hypo pools
- build_pool(ob_max, ind_max, riskscore_max, ob_ex, ind_ex, risk_score_tbl, tables, force_high, force_low, is_simple_industry, n_simple_industry)¶
Creates a hypothetical pool
General Algorithm
Number of obligors is determined based on concentration limitations. Start with exceptions, then use base
Rating mixture of the pool is determined based on max DBRSM Risk Score. First, impose credit dispersion via the force_low and force_high parameters. Then solve for rating mixture on the remaining pool such that the total pool risk score is approximately the target riskscore_max
Apply industry exceptions starting with largest obligors
Apply industries to the remaining obligors using the base max industry limit
- Parameters
ob_max (float) – base max obligor concentration limitation
ind_max (float) – base max industry concentration limitation
riskscore_max (float) – max DBRSM risk score of the pool
ob_ex (list[objects.ConcLimitException]) – obligor concentration limitations
ind_ex (list[objects.ConcLimitException]) – industry concentration limitations
risk_score_tb (dict[int, float]) – lookup table for DBRSM Risk Score
tables (dict) – lookup tables. Must contain keys: ind_codes, dscore, dbrs_rtg
force_high (tuple) – (rating_number, pct) for higher rtg prior to solving for risk score, force this on pool
force_low (tuple) – (rating_number, pct) for lower rtg prior to solving for risk score, force this on pool
is_simple_industry (bool) – if true, industry allocation is done on a repeating sequence. Hypo only iterates on obligors in this case.
n_simple_industry (int) – if is_simple_industry is True, this is the number of industries to repeat in sequence
- Returns
pool of Obligors. Assumes one dummy security per obligor, these are setup later.
- Return type
OrderedDict[objects.Obligor]
Notes
This method does not constrain on pool-wide diversity metrics
- build_pool_ind_mult_of_ob(ob_max, ind_mult, ind_floor, riskscore_max, ob_ex, ind_ex, risk_score_tbl, tables, force_high, force_low, is_simple_industry, n_simple_industry)¶
Used When Building a Pool Where Base Industry is a Function of base ob and ind floor
- Parameters
ob_max (float) – base max obligor concentration limitation
riskscore_max (float) – maximum DBRSM risk score constraint
ob_ex (list[clo_internal_objects.ConcLimitException]) – obligor concentration limitations
ind_ex (list[clo_internal_objects.ConcLimitException]) – industry concentration limitations
tables (dict[str, np.ndarray]) – Lookup tables for diversity score and industry codes
ind_mult (float) – base industry concentration is a function of this multiple * obligor base conc limit
ind_floor (float) – lowest level that the base industry concentration limitation is allowed to spin down to
- Returns
pool of Obligors. Assumes one dummy security per obligor
- Return type
OrderedDict[objects.Obligor]
- build_rating_mixture(riskscore_max, hypo_pool, risk_score_tbl, force_high, force_low)¶
- Parameters
riskscore_max (float) – maximum DBRSM risk score constraint
hypo_pool (list[clo_internal_objects.Obligor]) – pool of obligors to calculate the metric on
risk_score_tbl (dict[int, float]) – lookup table for DBRSM Risk Score
force_high (tuple) – (rating_number, pct) for higher rtg prior to solving for risk score, force this on pool
force_low (tuple) – (rating_number, pct) for lower rtg prior to solving for risk score, force this on pool
- Returns
length of hypo pool, array of ratings after applying force high, force low ratings
- Return type
numpy.ndarray