Debug Example

from absbox.examples import test05
from absbox import 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/stable/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.3

Cashflow Debug Steps

If user thinks something is off in the cashflow , here is couple steps to inspect

  1. Is Pool Cashflow Correct ?

    Please inspect

    r['pool']['flow']

  2. Is Waterfall Distribution Correct ?

    Pls inspect accounts

    r['accounts']['<AccountName>']

  3. Is fee paid correct ?

    Pls inspect

    r['fees']['<FeeName>']

Inspect Values at End Of Day

User can have the inspect any formula based values during the cashflow projection.

User need to supply ("inspect", (<DatePattern>,<Formula>)....) in the deal run assumption

r = localAPI.run(test05
             ,poolAssump = None
             ,runAssump = [("inspect",["MonthEnd",("poolFactor",)]
                                     ,["QuarterEnd",("poolBalance",)]
                                     ,['MonthEnd',("curPoolCollection",None,"Principal")]
                                     ,['MonthEnd',("status","Amortizing")])]
             ,read=True)
/home/docs/checkouts/readthedocs.org/user_builds/absbox-doc/envs/stable/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(

View the inspection

r['result']['inspect']['<PoolFactor>'].head()
<PoolFactor>
Date
2021-03-01 1
2021-03-31 1
2021-04-30 0.905868
2021-05-31 0.858331
2021-06-30 0.810477

Or , to view multiple variable and auto join by dates

from absbox import unifyTs

unifyTs(r['result']['inspect'].values()).head()
<CurrentPoolBalance> <IsDealStatus:<Amortizing>> <PoolCurCollection:<['CollectedPrincipal']>,<None>> <PoolFactor>
Date
2021-03-01 2200 False 0 1
2021-03-31 2200 False 0 1
2021-04-30 NaN True 207.09 0.905868
2021-05-31 NaN True 104.58 0.858331
2021-06-30 1783.05 True 105.28 0.810477

Inspect Values during the Waterfall

The ("inspect", (<DatePattern>,<Formula>)....) only inspect values at the end of day basis.

If user want to inspect values during in a waterfall , user need to annotate which variable in the waterfall.

Syntax

['inspect','comment',<Formula>]

test05.waterfall
{'amortizing': [['calcInt', 'A1'],
  ['inspect', 'After AccureInteret bond:A1', ('bondDueInt', 'A1')],
  ['payInt', 'acc01', ['A1']],
  ['inspect', 'After Pay', ('bondDueInt', 'A1')],
  ['payPrin', 'acc01', ['A1']],
  ['payPrin', 'acc01', ['B']],
  ['payIntResidual', 'acc01', 'B']]}
r['result']['waterfallInspect'].head(10)
Date Comment DealStats Value
0 2021-06-20 After AccureInteret bond:A1 {'CurrentDueBondInt': ['A1']} 15.34
1 2021-06-20 After Pay {'CurrentDueBondInt': ['A1']} 0.00
2 2021-07-20 After AccureInteret bond:A1 {'CurrentDueBondInt': ['A1']} 3.12
3 2021-07-20 After Pay {'CurrentDueBondInt': ['A1']} 0.00
4 2021-08-20 After AccureInteret bond:A1 {'CurrentDueBondInt': ['A1']} 2.55
5 2021-08-20 After Pay {'CurrentDueBondInt': ['A1']} 0.00
6 2021-09-20 After AccureInteret bond:A1 {'CurrentDueBondInt': ['A1']} 1.86
7 2021-09-20 After Pay {'CurrentDueBondInt': ['A1']} 0.00
8 2021-10-20 After AccureInteret bond:A1 {'CurrentDueBondInt': ['A1']} 1.13
9 2021-10-20 After Pay {'CurrentDueBondInt': ['A1']} 0.00