First Loss Example
Init
from absbox import examples,API,EnginePath
localAPI = API(EnginePath.DEV, lang='english', check=False)
Connecting engine server -> https://absbox.org/api/dev
/home/docs/checkouts/readthedocs.org/user_builds/absbox-doc/envs/latest/lib/python3.11/site-packages/urllib3/connectionpool.py:1097: InsecureRequestWarning: Unverified HTTPS request is being made to host 'absbox.org'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
warnings.warn(
✅Connected, local lib:0.52.3, server:0.52.4
Run Input
Using endpoint runRootFinder()
Start with a tuple with :
“firstLoss”
deal object
performance assumption
run assumption
bond name
r0 = localAPI.runRootFinder(
examples.test01
,("Pool",("Mortgage",{"CDRPadding":[0.01,0.02]},{"CPR":0.02},{"Rate":0.1,"Lag":5},None)
,None
,None)
,[]
,("firstLoss", "A1")
)
/home/docs/checkouts/readthedocs.org/user_builds/absbox-doc/envs/latest/lib/python3.11/site-packages/urllib3/connectionpool.py:1097: InsecureRequestWarning: Unverified HTTPS request is being made to host 'absbox.org'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
warnings.warn(
Result
The first element in the r0 is the factor which will cause first 0.01 loss on the bond
r0[0]
38.68797748235171
The second element in the r0 is
the deal
the stressed performance assumption used
the run assumption used
r0[1]
[{'MDeal': {'name': 'TEST01',
'status': {'PreClosing': {'tag': 'Amortizing'}},
'dates': {'GenericDates': {'ClosingDate': {'SingletonDate': '2021-04-01'},
'CutoffDate': {'SingletonDate': '2021-03-01'},
'FirstPayDate': {'SingletonDate': '2021-06-20'},
'FirstCollectDate': {'SingletonDate': '2021-04-01'},
'StatedMaturityDate': {'SingletonDate': '2030-01-01'},
'DistributionDates': 'DayOfMonth',
'CollectionDates': 'MonthFirst'}},
'accounts': {'acc01': {'accBalance': 0,
'accName': 'acc01',
'accInterest': None,
'accType': None,
'accStmt': None}},
'fees': {},
'bonds': {'A1': {'bndName': 'A1',
'bndType': 'Sequential',
'bndOriginInfo': {'originBalance': 1000,
'originDate': '2020-01-03',
'originRate': 0.07,
'maturityDate': None},
'bndInterestInfo': {'Fix': [0.08, 'DC_ACT_365F']},
'bndStepUp': None,
'bndBalance': 1000,
'bndRate': 0.07,
'bndDuePrin': 0,
'bndDueInt': 0,
'bndDueIntOverInt': 0,
'bndDueIntDate': None,
'bndLastIntPay': None,
'bndLastPrinPay': None,
'bndStmt': None,
'tag': 'Bond'},
'B': {'bndName': 'B',
'bndType': 'Equity',
'bndOriginInfo': {'originBalance': 1000,
'originDate': '2020-01-03',
'originRate': 0.07,
'maturityDate': None},
'bndInterestInfo': {'Fix': [0, 'DC_ACT_365F']},
'bndStepUp': None,
'bndBalance': 1000,
'bndRate': 0,
'bndDuePrin': 0,
'bndDueInt': 0,
'bndDueIntOverInt': 0,
'bndDueIntDate': None,
'bndLastIntPay': None,
'bndLastPrinPay': None,
'bndStmt': None,
'tag': 'Bond'}},
'pool': {'MultiPool': {'PoolConsol': {'assets': [{'Mortgage': [{'originBalance': 2200,
'originRate': {'Fix': ['DC_ACT_365F', 0.045]},
'originTerm': 20,
'period': 'Monthly',
'startDate': '2021-02-01',
'prinType': 'Level',
'prepaymentPenalty': None,
'obligor': None,
'tag': 'MortgageOriginalInfo'},
2200,
0.08,
20,
None,
'Current']}],
'futureCf': None,
'futureScheduleCf': None,
'asOfDate': '2021-03-01',
'issuanceStat': {},
'extendPeriods': 'MonthEnd'}}},
'waterfall': {'DistributionDay Amortizing': [{'AccrueAndPayInt': [None,
'acc01',
['A1'],
None]},
{'PayPrin': [None, 'acc01', ['A1'], None]},
{'PayPrin': [None, 'acc01', ['B'], None]},
{'PayIntResidual': [None, 'acc01', 'B']}]},
'collects': [{'Collect': [None, 'CollectedInterest', 'acc01']},
{'Collect': [None, 'CollectedPrincipal', 'acc01']},
{'Collect': [None, 'CollectedPrepayment', 'acc01']},
{'Collect': [None, 'CollectedRecoveries', 'acc01']}],
'stats': [{}, {}, {}, {}],
'liqProvider': None,
'rateSwap': None,
'rateCap': None,
'currencySwap': None,
'custom': None,
'triggers': None,
'ledgers': None}},
{'PoolLevel': [{'MortgageAssump': [{'DefaultVecPadding': [0.3868797748235171,
0.7737595496470342]},
{'PrepaymentCPR': 0.02},
{'Recovery': [0.1, 5]},
None]},
[],
'DummyDefaultAssump']},
{'stopRunBy': None,
'projectedExpense': None,
'callWhen': None,
'revolving': None,
'interest': None,
'inspectOn': None,
'buildFinancialReport': None,
'pricing': None,
'fireTrigger': None,
'makeWholeWhen': None,
'issueBondSchedule': None,
'refinance': None},
[]]