model_clo_insight.app module¶
Module for the Methods to be Hosted as RESTful APIs
Can be accessed as RESTful APIs with web-based clients such as Jupyter Notebooks or Javascript UIs
Can be accessed locally via XL Wings
- _step_5_final_results_mode_1_2(deal, inputs)¶
Performs the final aggregation of trading scenario results from 4a (cashflow BDRs, pasted in from Proprietary Cashflow Engine) and the Predictive Model simulation results matrix. The cushion per scenario is calculated, and a summary matrix computed. This is the final step in the analysis.
For modes 1 & 2, we use the Scenario Matrix (generated in step 3) as the base matrix for merging in all the results
- Parameters
deal (
CLOTransaction
) – transaction capital structure and key termsinputs (
InputStep5
) – details inmodel_clo_insight.clo_external_data_contracts.InputStep5
- Return type
- Returns
details in
model_clo_insight.clo_external_data_contracts.OutputStep5
General Steps
Build tranche and scenario dataframes
Determine default hurdle rates for each tranche
Build dataframe of break evens (BDRs) that were pasted in from Proprietary Cashflow Engine
Determine governing BDRs per tranche per scenario (min for AAA, avg for the rest)
Compute cushion (BDR - default hurdle rate)
Filter scenarios by the user ‘is_on’ choice
Compute stats and summary results table
Setup output dataclass structure
- _step_5_final_results_mode_3(deal, inputs)¶
Performs the final aggregation of trading scenario results from 4a (cashflow BDRs, pasted in from Proprietary Cashflow Engine) and the Predictive Model simulation results matrix. The cushion per scenario is calculated, and a summary matrix computed. This is the final step in the analysis.
For Mode 3, we use the deal matrix as the base matrix for merging in all the results
- Parameters
deal (
CLOTransaction
) – transaction capital structure and key termsinputs (
InputStep5
) – details inmodel_clo_insight.clo_external_data_contracts.InputStep5
- Return type
- Returns
details in
model_clo_insight.clo_external_data_contracts.OutputStep5
General Steps
Build tranche and deal matrix dataframes
Build scenario dataframe
Map default hurdle rates from scenario matrix -> deal matrix
Determine default hurdle rates for each tranche
Build dataframe of break evens (BDRs) that were pasted in from Proprietary Cashflow Engine
Determine governing BDRs per tranche per scenario (min for AAA, avg for the rest)
Compute cushion (BDR - default hurdle rate)
Compute stats and summary results table
Setup output dataclass structure
- step_1_parse_pool(deal, indicative_pool, overrides=None)¶
Ingests the transaction structure and indicative portfolio. Computes key metrics on the indicative portfolio. Loads in assumption tables from methodology reference. Note that outputs from this step are used in multiple subsequent steps
- Parameters
deal (
CLOTransaction
) – transaction capital structure and key terms like deal.trading_scenario_modeindicative_pool (
List
[CLOPoolRow
]) – portfolio data (loan tape)overrides (
Optional
[Dict
]) – optional input to override methodology parameters
- Return type
- Returns
pool metrics, modeling pool, and recommended values for trading scenarios
General Steps
Indicative portfolio: Mapped data
Indicative portfolio: Derived data (computed values)
Compute pool metrics
Compute portfolio strats
Build replines - Indicative Portfolio
Build replines - Trading scenario recommendations
Compute trading scenario recommended parameters
Rounding and date cleanup
Setup output dataclass structure
- step_2_run_indicative_pool(deal, inputs, overrides=None)¶
Ingests the indicative portfolio and cutpoint tenors. Runs the core Predictive Model algorithm to generate the cumulative default distribution & compute percentiles -> hurdle rates
- Parameters
deal (
CLOTransaction
) – transaction capital structure and key termsinputs (
InputStep2
) – details inmodel_clo_insight.clo_external_data_contracts.InputStep2
overrides (
Optional
[Dict
]) – optional input to override methodology parameters
- Return type
- Returns
details in
model_clo_insight.clo_external_data_contracts.OutputStep2
General Steps
Create internal CLO objects (obligors, loans, transaction, settings, meth params)
Setup object references
Run simulation to generate time-to-default (ttd) matrix
Loop through each rating-based amortization schedule to compute default hurdle rates and diagnostic statistics (this is how prepayment assumptions are implemented)
Create tranche results dataframe
Setup output dataclass structure
- step_3_build_trading_scenarios(deal, inputs, overrides=None)¶
Builds out trading scenarios as per new methodology approach. Runs hypo pool on each to infer WARF/risk score, but do not run simulation algo.
Recommended inputs in this step are displayed to the Analyst as Step 1 output, but the analyst may choose to use the recommendend values or override the recommended values using the choice values. If analyst chooses to override recommendend values, they must include a rationale in the comment fields.
- Parameters
deal (
CLOTransaction
) – transaction capital structure and key termsinputs (
InputStep3
) – details inmodel_clo_insight.clo_external_data_contracts.InputStep3
overrides (
Optional
[Dict
]) – optional input to override methodology parameters
- Return type
- Returns
details in
model_clo_insight.clo_external_data_contracts.OutputStep3
General Steps
If mode 3, map deal matrix to modeling matrix (row for row) and create dataframe
If mode 1 or 2, create dataframe for investment grade scenarios
If mode 1 or 2, create dataframe for AAA scenarios
Setup hypo pool parameters and lookup tables
Main loop:
Solve for industry/obligor concentration limitations s.t. target Dscore is realized
If mode 1, solve for rating mixture s.t. BDR ~ SDR (e.g. the CDO Monitor test), For Mode 2 and 3, the respective deal matrices are used.
Build a row for the results, and the diagnostics
Build results and diagnostics dataframes
Setup output dataclass structure
- step_4a_generate_cf_scenarios(deal, inputs, overrides=None)¶
This step is used to build out the cash flow matrix for the trading scenarios. It is designed to be used in Proprietary Cashflow Engine out-of-the-box, but may also be used in Intex with some modifications. The scenarios are built around the unique combinations of WAS and seniority/WARR that arise from the trading scenarios.
- Parameters
deal (
CLOTransaction
) – transaction capital structure and key termsinputs (
InputStep4a
) – details inmodel_clo_insight.clo_external_data_contracts.InputStep4a
overrides (
Optional
[Dict
]) – optional input to override methodology parameters
- Return type
- Returns
details in
model_clo_insight.clo_external_data_contracts.OutputStep4a
General Steps
If mode 3:
Determine unique WAS
Determine unique WARR and create an integer ID
Determine repline balances s.t. target WARR is met for all unique WARR keys
If mode 1, 2:
Create filtered scenario dataframe based on analyst ‘is_on’ choice
Create integer keys for seniority
Create integer keys for WAS
Use numpy operations to create scenario matrix
Setup output dataclass structure
- step_4b_run_trading_scenarios(deal, inputs, overrides=None)¶
This method runs the trading scenario matrix through the Predictive Model simulation. The hypo pools are re-generated identical to step 3, and the resulting pools run through the simulation.
- Parameters
deal (
CLOTransaction
) – transaction capital structure and key termsinputs (
InputStep4b
) – details inmodel_clo_insight.clo_external_data_contracts.InputStep4b
overrides (
Optional
[Dict
]) – optional input to override methodology parameters
- Return type
- Returns
details in
model_clo_insight.clo_external_data_contracts.OutputStep4b
General Steps
Setup scenario dataframe and filter out based on user ‘is_on’ choice
Setup hypo pool parameters and lookup tables
Create internal CLO objects (transaction, settings, meth params)
Setup amortization matrix
Main execution loop:
Solve for industry/obligor concentration limitations s.t. target Dscore is realized
If mode 1, solve for rating mixture s.t. BDR ~ SDR (e.g. the CDO Monitor test). For mode 2 and 3, use hypo_pool.HypoResultMonitor to generate results using matrices.
Create lists of Obligor and Loan objects from the hypo pool
Run simulation to generate time-to-default (ttd) matrix
Loop through each rating-based amortization schedule to compute default hurdle rates and diagnostic statistics (this is how prepayment assumptions are implemented)
Create results and diagnostics dataframes
setup output dataclass structure
- step_5_final_results(deal, inputs, overrides=None)¶
Wrapper for the final aggregation method. The logic is quite different for modes 1, 2 vs 3. There are 2 internal methods below that handle each of these paths:
- Parameters
deal (
CLOTransaction
) – transaction capital structure and key termsinputs (
InputStep5
) – details inmodel_clo_insight.clo_external_data_contracts.InputStep5
overrides (
Optional
[Dict
]) – optional input to override methodology parameters
- Return type
- Returns
details in
model_clo_insight.clo_external_data_contracts.OutputStep5