Skip to content
Prev 1167 / 12125 Next

[R-pkg-devel] environment scoping

All,

Thank you, I have built the package such that it passes an object TermStrutrure to those functions which require it as an input.  The package is here

https://github.com/glennmschultz/BondLab <https://github.com/glennmschultz/BondLab>

The question is largely motivated by the source MortgageScenario.R and MortgageOAS.R.  I have decided to default to Diebold Lee model in termstuc.

 In the case of MortgageScenario.R:

Currently shift in the curve is driven by shift in the coupon curve and the term structure model is refit.  Naturally one could use the coefficients from the original fit to shift the curve making the 		analysis much faster and more intuitive than the current paradigm of shifting the coupon curve.  However, some portfolio prefer to be able to use either or.  So, I need to make either/or available.

In the case of MortgageOAS.R

This is currently a single factor CIR OAS model.  It will remain for teaching purposes as a single factor model is the gateway to multi-factor models.  Nevertheless, one may choose to batch job OAS across say 500 MBS.  In which case it makes little sense to replicate the paths 500 times.  Simulate the paths and pass them to the function.  Obviously, I am looking at parallel processing of a portfolio mortgage and asset backed securities.  Thank-you for the time that you have taken to consider and reply to my question.  This has been very helpful.

Best,
Glenn