Simulates a 100-loan securitized portfolio, structures Senior/Mezzanine/Equity tranches, and calculates Internal Rate of Return (IRR) for each tranche β modeling the core mechanics of Asset-Backed Securities.
Models the full lifecycle of an Asset-Backed Security (ABS) from loan origination through cash flow waterfall to tranche-level IRR. Generates a portfolio of 100 randomized amortizing loans, computes month-by-month cash flows using the annuity formula, allocates payments across a 70/20/10 Senior/Mezzanine/Equity capital structure, and calculates the IRR for each tranche.
| Tranche | Share | Risk Level | Priority |
|---|---|---|---|
| Senior | 70% | Low | First in line |
| Mezzanine | 20% | Medium | Second |
| Equity | 10% | High | Last (residual) |
- Loan Portfolio Generation β 100 loans with randomized principals ($10Kβ$50K) and interest rates (5%β15%)
- Amortization Engine β Monthly payment calculation using the annuity formula with balance tracking
- Cash Flow Aggregation β Sums individual loan cash flows into monthly portfolio-level flows
- Tranche Structuring β Allocates principal and interest across Senior/Mezzanine/Equity tranches
- IRR Computation β numpy-financial IRR calculation per tranche
- Cash Flow Visualization β Monthly portfolio cash flow plot
| Component | Technology |
|---|---|
| Language | Python 3.9+ |
| Finance | numpy-financial (IRR) |
| Analytics | NumPy |
| Visualization | Matplotlib |
git clone https://github.com/RHarmit/ABS-Cash-Flow-Simulation-IRR.git
cd ABS-Cash-Flow-Simulation-IRR
pip install numpy numpy-financial matplotlib
python ABS.PYTotal Principal: $2,987,432.11
Total Cash Collected: $3,412,876.54
Senior Investment: $2,091,202.48 | Cash: $2,389,013.58 | IRR: 0.79%
Mezzanine Investment: $597,486.42 | Cash: $682,575.31 | IRR: 0.79%
Equity Investment: $298,743.21 | Cash: $341,287.65 | IRR: 0.79%