Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RunPool consistency. #61

Closed
dandevmsc opened this issue Apr 9, 2024 · 2 comments
Closed

RunPool consistency. #61

dandevmsc opened this issue Apr 9, 2024 · 2 comments

Comments

@dandevmsc
Copy link

Description
Great work on adding receivables to version 26.5, this is very useful!

Versions:
Hastructure: 0.26.5
Absbox: 0.26.6

from absbox import API
localAPI = API("http://localhost:8081/",lang='english')

receivable = [["Invoice",
              {
                "start":"2024-03-01",
                "originBalance":2000,
                "originAdvance":1500,
                "dueDate":"2024-06-01",
                "feeType":("FixedRate",0.1)
            }
              ,{
                 #"currentBalance":1500,
                # "remainTerm":3.0,
                 "status":"Current"
                 }
                 
                 ]]

x = {'assets':receivable,'cutoffDate':'2024-03-01'}


poolAssump = ("Pool",("Mortgage",None,None,None,None),None,None)
#poolAssump = ("Pool",("Receivable",None,None,None),None,None) # this works
print(localAPI.runPool(x,poolAssump=poolAssump,read=True))     
  • Could we get an error if the poolAssump type doesn't match the asset type?
  • Does it make sense to have the poolAssump changed to "Invoice" rather than "Receivable" to be consistent.
  • Could we clarify in the docs that Receivables only takes in 3 pool assumptions.
@yellowbean
Copy link
Owner

yellowbean commented Apr 9, 2024

  • Could we get an error if the poolAssump type doesn't match the asset type?

Yes, the mismatch of asset with its performance assumption is headache if there isn't any tips, it is better to be enhance at Hastructure level. This task is blocked with error message handling #159. Current engine just stops returning any useful error message if it came into exception. This enhancement will be included in 0.27.x

  • Does it make sense to have the poolAssump changed to "Invoice" rather than "Receivable" to be consistent.

The first element of Assumption tuple ( like "Mortgage", "Receivable" ..) , represent a boarder concept called category, which contains a collection of assets.

Pool assumption ("Mortgage".. ) can be used to apply for asset Mortgage, AdjustRateMortgage ... ( why there are two separate assets in the same category ? because AdjustRateMortgage has different fields that Mortgage...how about merging two assets into single one asset called "mortgage" ? This will result in lots of fields of Mortgage asset. it's easy to maintain 10 mortgage assets with 5 fields each. but it's not easy to maintain 1 mortgage asset with 50 fields.

code refer to : https://github.com/yellowbean/Hastructure/blob/2309478005f8cb0bc087f882d61aae9eb877ab45/src/AssetClass/AssetBase.hs#L165

Receivable is more generalized concept, which represent something to be collected without interest.

  • Invoice is a type of asset belongs to such category. There could be other asset with similar attributes, like , commercial paper which may have different fields ( even it's not implemented ).

  • but pool assumption is base on common attributes of all assets under same category. like "DefaultAtEnd" should be applied to commercial paper as well as invoice . the same rule applies to Mortgage category as well, CDR can be applied to asset Mortgage and asset AdjustRateMortgage.

Designing this way is for easy scalability, for each category can include new asset. For example, like Dutch RMBS would have different Mortgage attributes, or Insured Mortgage which may have extra fields for insurance setting. But all these mortgage asset shall be in same category and share same pool performance assumption.

. The confusion maybe be raised because there is an asset named Mortgage and there is a category called Mortgage as well.

Screenshot 2024-04-10 at 02 00 38

let me know if this make sense.

  • Could we clarify in the docs that Receivables only takes in 3 pool assumptions.
    Sure, I'll fix this in coming days.

@dandevmsc
Copy link
Author

Okay this makes sense, thanks a lot for the thorough explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants