Login  Register

Re: mortgage bond

Posted by stefanadelbert on Apr 06, 2009; 5:56am
URL: http://quantlib.414.s1.nabble.com/mortgage-bond-tp12877p12887.html

I was thinking of doing something fairly similar with QuantLib as part of a homeloan calculator I'm working on. My idea was to add to the C# codebase that is part of QLNet and extend the Bond class. I'm not as concerned about pricing the mortgage as generating payment and amortising principal schedules.

My background is in C++ so I would be OK working on C++ codebase, but would prefer to work directly on the C# codebase as C# would suit my purposes better.

Please get in touch if you reckon we could collaborate on this.

Stefan

Nathan Abbott wrote
I am c++ programmer that only knows the basics of quantitative finance.
Because I have been programming with QuantLib for two years, I think I have
a good understanding on how QuantLib works. Luigi Ballabio's * Implementing
QuantLib *has been a great help on understanding QuantLib. I am working with
a financial person who uses my program, He is fluent with quantitative
finance, but only knows a little c++ and does not know how QuantLib works.

We want to implement a simple version of mortgage bonds through a
MorgtageBond class that will probably inherit from the Bond class (and maybe
a FixedRateMortageBond and FloatingRateMortageBond classes derived from the
MortgageBond class) and would like to solicit some
opinions/suggestions/objections.

Currently we are thinking that it will be defined similar to the amortizing
bond classes (taking in a vector of nominals and dates generated outside of
QuantLib), but be derived from bond (and inherit all it's functions) and
adding specific functions to it (like weighted average life calculation).
Has anyone already done/thought of doing something similar?

Secondly, assuming prepayments are not an issue (which for our purposes they
are not), a simple mortgage bond is priced similar to corporate bonds,
meaning as a spread over swaps (i.e. on a yield basis, yield = swap rate +
spread), then use that sum as the yield to calculate the price. The bond
class has dirtyPrice and cleanPrice functions which take yield as an input.
We can get the par rate from the yield curve by using the parRate function
or instantiate a simple swap (as explained in yieldtermstructure.hpp
comments).

Our question is w.r.t the spread. We want to build a spread grid/matrix with
rating on one axis/rows and maturity/columns on the other. We were thinking
of creating a termspreadsurface (similar to capfloortermvolsurface) which
could be useful for mbs and corporate bonds (spread per rating/term). Has
anyone already done something similar?

Btw, if anybody is interested in residential prepayments/OAS calculations
and willing to implement that or is working on that, please contact me and
we can hopefully coordinate. Please note however that we have limited
(almost zero) expertise on that subject.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-dev mailing list
QuantLib-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/quantlib-dev