yellowbean / Hastructure

ABS/MBS cashflow engine written in Haskell, with API to Python and C/Java (on the way)
https://deal-bench.xyz
Other
16 stars 4 forks source link

When RunPool on two assets, but cumuPrepayment is not summing up #164

Closed yellowbean closed 5 months ago

yellowbean commented 5 months ago
mortgage1 = ["Mortgage"
            ,{"originBalance": 12000.0
            ,"originRate": ["fix",0.045]
            ,"originTerm": 40
            ,"freq": "monthly"
            ,"type": "level"
            ,"originDate": "2021-02-01"}
            ,{"currentBalance": 10000.0
            ,"currentRate": 0.075
            ,"remainTerm": 30
            ,"status": "current"}]

mortgage2 = ["Mortgage"
            ,{"originBalance": 8000.0
            ,"originRate": ["fix",0.045]
            ,"originTerm": 25
            ,"freq": "monthly"
            ,"type": "level"
            ,"originDate": "2021-02-01"}
            ,{"currentBalance": 6000.0
            ,"currentRate": 0.075
            ,"remainTerm": 15
            ,"status": "current"}]

myPool = {'assets':[ mortgage1, mortgage2  ],
         'cutoffDate':"2022-03-01"}

assetLevelAssump = ("ByIndex"
                      ,([0],(("Mortgage",{"CDR":0.01},None,None,None)
                                    ,None
                                    ,None))
                       ,([1],(("Mortgage",None,{"CPR":0.01},None,None)
                                    ,None
                                    ,None))
                      )

r = localAPI.runPool(myPool
                  ,poolAssump=assetLevelAssump
                  ,read=True)

r['PoolConsol'][0]

Screenshot 2024-04-22 at 14 36 12

yellowbean commented 5 months ago

fixed with 414965d