model_clo_insight.clo_internal_objects module¶
This module serves as the location for all of the internal model object classes used in the computational engines.
- Setup() method:
used for assigning relationships based on other objects in the model
- class CorpLoan(ident, name, prop_id, par, tenor=None, recovery_rate=None, custom_pd_curve=None)¶
Bases:
object
Represents a Loan to a Corporation
- amort_sched¶
amortization schedule for loan
- contract_tenor¶
actual tenor of the Security, only used in the modeling if turned on in settings
- Type
- ident¶
unique identifier for the loan
- Type
string
- name¶
name identifier for loan
- Type
string
- pd¶
default probability, based on the PD curve of the obligor, tenor of security
- pd_normed¶
pd converted to standard normal
- prop_id¶
identifier for the parent Obligor
- Type
string
- recovery_rate¶
asset specific recovery used for the Security, only used in the modeling if turned on in settings
- Type
- reset()¶
- set_amort(raw_amort, settings)¶
Compute amortization schedule for this Corp Loan
- Parameters
raw_amort – list[float]: array containing the remaining balance at the end of each year (optional)
settings – takes in objects.ModelSettings
- Returns
amortization schedule
- setup(obligors, transaction, settings)¶
Setup method for the CorpLoan class
CorpLoan needs access to the fields of its parent Obligor. This method also uses the Settings object to determine which tenor assumption to use. The security PD is normalized here so that the random normals in the simulation do not have to be converted to uniforms, which saves computation time
- Parameters
obligors (list[clo_internal_objects.Obligor]) – all Properties in the pool
transaction – TransactionData: pool/deal data (custom PD curves)
settings – ModelSettings: contains settings for tenor
- Returns
None
Notes
self.pd not used in the simulation, but is needed to compute pool metrics
- tenor¶
float:
- class HypoPoolRow(row, ind_code, numerical_rtg, pct, total_par, pd_curve)¶
Bases:
object
Represents a single line item in a pool generated by the hypo pool generators
- compute_pd(tenor, pd_lookup)¶
- pd_curve: numpy.ndarray¶
cumulative pd curve (from IDT)
- class MethodologyParamsDefaults(IDT, rating_list, rtg_regime_map, correl)¶
Bases:
object
Contains the Methodology Parameters for Simulating Defaults in the Pooling Method
Notes
Typically these are stored in a
json
file inside the project- IDT¶
DBRS idealized default table
- Type
list of list
- correl_diff_reg_diff_ind¶
depricated in methodology, but functionality available in model
- correl_diff_reg_same_ind¶
depricated in methodology, but functionality available in model
- class ModelSettings(n_trials, seed, n_bins, is_stochastic_rec=False, is_asset_specific_rec=False, is_asset_specific_tenor=False, is_custom_pd=False, is_amort=False)¶
Bases:
object
Contains the User-Specified Model Settings for the Pooling Method
- is_amort¶
if true, build asset-specific amortization schedules in terms of remaining balance
- Type
- n_bins¶
number of bins to build the default/loss distribution
- class Obligor(name, ind_code, numerical_rtg, pd_curve_ref=None)¶
Bases:
object
Represents the Obligor Securing a Corporate Loan
Data variables
- _calc_total_par(securities)¶
Calculates total par across all securities belonging to this Obligor
- Parameters
securities – all securities belonging to obligor
- Returns
Total Par for all securities
- custom_pd_curve¶
optional, used to lookup custom PD curve vs PD base on rating
- Type
string
- name¶
unique identifier
- Type
string
- numerical_rtg¶
DBRSM numerical rating (fractional implies split public ratings)
- reset()¶
Not applicable for Obligor
Returns:
- setup(corp_loans, transaction, methodology)¶
Setup method for the Obligor class
Obligors need to know the Corp Loans that belong to them in order to calculate total_par. This method also sets up the PD curve.
- Parameters
corp_loans (list[clo_internal_objects.CorpLoan]) – Corp Loans belonging to this Obligor (one Obligor can have many Corp Loans)
transaction (clo_internal_objects.TransactionData) – pool/deal data (custom PD curves)
methodology (clo_internal_objects.MethodologyParamsDefaults) – contains IDT for PD lookup from rating
- Returns
None
- class PoolPosition(row, ob_name, sec_name, ind_code, rtg, par, rec_rate, tenor, pd_curve)¶
Bases:
tuple
represents raw row of data for pooling inputs
- _asdict()¶
Return a new dict which maps field names to their values.
- _field_defaults = {}¶
- _fields = ('row', 'ob_name', 'sec_name', 'ind_code', 'rtg', 'par', 'rec_rate', 'tenor', 'pd_curve')¶
- _fields_defaults = {}¶
- classmethod _make(iterable)¶
Make a new PoolPosition object from a sequence or iterable
- _replace(**kwds)¶
Return a new PoolPosition object replacing specified fields with new values
- ind_code¶
- ob_name¶
- par¶
- pd_curve¶
- rec_rate¶
- row¶
- rtg¶
- sec_name¶
- tenor¶
- class TransactionData(pool_tenor, tranche_tenor_rolldown, tranche_tenor_level, tranche_tenor_rtg, pool_amort=None, custom_pd_dict=None)¶
Bases:
object
Contains the Transaction Level Data
Pool and deal-level information. This object also contains transaction-specific lookup tables and settings
- custom_pd_dict¶
dictionary to assign asset PD curves based on custom curve in the simulation method
- pool_amort¶
pool amortization per rating regime
- Type
dict of lists
- setup(obligors)¶
Setup method for the Transaction Data
Transaction needs to know the Property in the pool in order to determine which property types & MSA Groups to shock in the simulation.
- Parameters
obligors – list of Obligor: obligors in the pool
Returns:
- tenors_agg¶
aggregate tenors across ratings stack
- Type
list of float
- tranche_tenor_level¶
expected final maturity of each tranche/rating level
- Type
list of float
- tranche_tenor_rtg¶
expected final maturity of each tranche/rating level
- Type
list of int
- build_obs_and_loans_sp(raw_pool, pool_wal)¶
Used to build / debug hypo, so just assume some dummy parameters for setttings and transaction