Skip to content

Commit

Permalink
expose default at end with rate assump
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowbean committed Aug 15, 2024
1 parent 7def2df commit f981746
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 0 additions & 1 deletion absbox/local/china.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def readTrgStmt(x):
return pd.DataFrame(list(tz.pluck("contents", tStmt)), columns=china_trigger_flow_fields_d).set_index("日期")



@dataclass
class SPV:
名称: str
Expand Down
2 changes: 2 additions & 0 deletions absbox/local/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -1442,6 +1442,8 @@ def mkAssumpDefault(x):
return mkTag(("DefaultByAmt", (vNum(bal), vList(rs,numVal))))
case "DefaultAtEnd":
return mkTag(("DefaultAtEnd"))
case {"DefaultAtEndByRate":(r1,r2)}:
return mkTag(("DefaultAtEndByRate", [vNum(r1), vNum(r2)]))
case _ :
raise RuntimeError(f"failed to match {x}")

Expand Down
8 changes: 7 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@ sphinxemoji
notebook
myst-nb
absbox
pyxirr
pyxirr
toolz
lenses
dateparser
more_itertools
pandas
python-dateutil
4 changes: 4 additions & 0 deletions docs/source/analytics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ Performing
* ``{"CDR":0.01}`` means 1% in annualized of current balance will be defaulted at the end of each period
* ``{"CDR":[0.01,0.02,0.04]}`` means a vector of CDR will be applied since the asset snapshot date (determined by ``remain terms``)
* ``{"ByAmount":(2000,[500,500,1000])}`` apply a custom default amount vector.
* ``{"DefaultAtEndByRate":(0.05,0.10)}``, will apply 5% as CDR for all periods except last period. The last period will use default CDR 10% (which start from begining day).

* <Prepayment Assumption>

Expand Down Expand Up @@ -187,6 +188,7 @@ Summary
"Default Assumption" -> "{'CDR':x}"
"Default Assumption" -> "{'CDR':[x...]}"
"Default Assumption" -> "{'ByAmount':(<total>, [x...])}"
"Default Assumption" -> "{'DefaultAtEndByRate':(x,y)}"
"Prepayment Assumption" -> "{'CPR':x}"
"Prepayment Assumption" -> "{'CPR':[x...]}"
"Recovery Assumption" -> "{'Rate':x,'Lag':y}"
Expand Down Expand Up @@ -230,6 +232,7 @@ Summary
Performing -> "Recovery Assumption"
"Prepayment Assumption" -> "{'CPR':x}"
"Default Assumption" -> "{'CDR':x}"
"Default Assumption" -> "{'DefaultAtEndByRate':(x,y)}"
"Recovery Assumption" -> "{'Rate':x,'Lag':y}"
}

Expand Down Expand Up @@ -269,6 +272,7 @@ Summary
Performing -> "Recovery Assumption"
"Prepayment Assumption" -> "{'CPR':x}"
"Default Assumption" -> "{'CDR':x}"
"Default Assumption" -> "{'DefaultAtEndByRate':(x,y)}"
"Recovery Assumption" -> "{'Rate':x,'Lag':y}"
}

Expand Down

0 comments on commit f981746

Please sign in to comment.