Re: z-spread

Posted by japari on
URL: http://quantlib.414.s1.nabble.com/z-spread-tp15361p15612.html

Gee, you just reminded me I promised Eric I was going to merge this with the last QLXL1.4 and I have been busy with other things.
Anyways, should merge fine but you can always use the previous QLXL; with the changes things work better (recalc mostly); thanks Eric, Nando and any other involved by the way.

The worksheet is no big deal; It compares some bonds risky and non risky pricing to their market quotes:
-MoneyMarket Wsheet its just for the date and YTS
-CreditMarket Wsheet bootstraps two CDS on the reference name of the bonds for two different seniorities. It reconstruct the default probability curves and reprice-test a 5Y CDS. The grey recovery numbers let you speculate with the possibility of matching the default curves (if you believe there can only be one event for both senioirites).
-BondPricing Wsheet is where the action lies; it has two blocks; the first one contains the market quotes of the reference bonds; only the fixed rate ones in blue are used (can be done with some of the floaters too with the code in QL) The second block reprices the bonds with each of the previous CDS curves independently of wether the curves are matching the bonds seniority. One would expect the seniority matching price to be closer to the market quote (you can check that...). It also prices the bonds ignoring the default component (pink curve). These results are shown in price and Z-spread on the two graphs(bonds are sorted by maturity); the difference between the theoretical(CDS/credit based) Z-spread and the market one is one way to measure the so called credit-basis (see the paper I mention below).

On the data set: not all bond prices are on the same 'todays' date and the CDS quotes are agregates of quotes close to that date. You can see this as some room for discrepancies in the pricing. Also I couldnt find the subordination of issues numbered 2,4,5 if anyone can find the data please add it since this is one key point in the example (see bond codes). I dont have access to data systems anymore.
Take conventions used with a pinch of salt, I tend to be 'flexible' on those.


As for ther reading any credit textbook will start with this one, see
->Chapter 4 of Modelling single name and multi-name credit derivatives. Dominic O’Kane
->Section 3.4.1 of Credit Derivatives Pricing Models. P.J. Schonbucher
->Strongly recommend you this short/great paper with some ideas to extend the worksheet if you want:
"Bond spreads as a proxy for credit default swap spreads" Mark Davies, Dimitry Pugachevsky; Bear Stearns
->Chapter 2 of Bielecki and Rutkowski should deal with that too but not so close to the models here.

Best
pp

----- Original Message -----

>
> Hi Pepe, I'm trying to recompile your set up, in the meanwhile can
> you suggest me some reference (paper or book) that explains what you
> do in the spreadsheet?
>
>
> Thanks
>
>
> Paolo
>
>
>
> 2014-06-06 17:38 GMT+02:00 Paolo Baroni < [hidden email] > :
>
>
>
> Thanks Pepe, I try!
> Ciao
> P
>
>
>
> 2014-06-06 16:44 GMT+02:00 < [hidden email] > :
>
>
>
>
> Hi Paolo,
> I did renamed the function, the reason is that now you can select the
> interpolation in the hazard rates of the bootstrapped curve. You
> need the extra code on top of 1.2.0, otherwise the excel sheet would
> not find the functions (that one and others).
>
> The safest way to go is to use a separate set up in your computer and
> recompile everything (lib and addin), downloading the merged changes
> in:
> https://github.com/japari/quantlib/archive/Credit_inQLXL.zip
> So you can discard it when your done if you dont want to integrate it
> in your code. Only keep in mind I have only updated project files
> for Linux (for QL) and for VC9 so if your using another version of
> visual studio you need to update the project files yourself
> (sometimes if you open the VC9 with newer versions it upgrades
> itself fine).
>
> Tell me if it doesnt work.
>
>
> Best
> Pepe
>
>
>
> ----- Original Message -----
> >
> > Hi Pepe I'm on quantlibxl 1.2.0 and I can't find the function
> > qlPiecewiseHazardRateCurve that you use in sheet 'credit market'
> > cell M9. Is it possible?
> > I can find qlPiecewiseFlatHazardRateCurve but I'm not sure how to
> > use
> > it (and if I can use it instead of the first one I mentioned).
> >
> >
> > Thanks, ciao
> >
> >
> > Paolo
> >
> >
> >
> > 2014-06-05 14:36 GMT+02:00 Paolo Baroni < [hidden email] > :
> >
> >
> >
> > Thanks a lot Pepe.
> > I'll try and I'll give you a feedback.
> >
> >
> > Ciao
> >
> >
> > Paolo
> >
> >
> >
> > 2014-06-05 14:34 GMT+02:00 < [hidden email] > :
> >
> >
> >
> >
> > Hi again, apologies for the previous pm Paolo, I keep using the
> > wrong
> > shortcut.
> >
> > For the second way, you can use
> > <ql/experimental/credit/riskybond.hpp>
> >
> > You can look for the sample sheet:
> > QuantLibXL/Workbooks/Credit/RiskyBonds.xls
> > which is a toy worksheet on exactly this problem with a real (more
> > or
> > less) market data case.
> > thats in
> > https://github.com/japari/quantlib/compare/Credit_inQLXL
> > which modifies a bit the previous and other code.
> > Write again if something does not work there.
> > Best
> > Pepe
> >
> >
> >
> >
> > ----- Original Message -----
> > >
> > >
> > > Well, in this case I'd like to price a fixed rate bond in two
> > > ways
> > > as
> > > follows:
> > >
> > >
> > > First way, compute the discount curve from quoted bond (same
> > > issuer)
> > > Second way, compute the discount curve from the benchmark curve
> > > and
> > > CDS spread
> > >
> > >
> > > What do you think?
> > >
> > >
> > > Thanks
> > >
> > >
> > > Paolo
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > 2014-06-05 10:56 GMT+02:00 Luigi Ballabio <
> > > [hidden email]
> > > > :
> > >
> > >
> > > It depends on what you want to do with CDS spreads. They can't be
> > > just
> > > added to the interest rates (financially, I mean). There's some
> > > conversion to z-spreads involved which depend on your pricing
> > > models.
> > >
> > > Luigi
> > >
> > >
> > >
> > >
> > > On Wed, Jun 4, 2014 at 10:03 PM, Paolo Baroni <
> > > [hidden email]
> > > > wrote:
> > > > Luigi, can I use the same function to manage CDS spread? Or
> > > > there
> > > > is a
> > > > different way?
> > > >
> > > > Thanks
> > > >
> > > > Paolo
> > > >
> > > >
> > > > 2014-06-04 12:01 GMT+02:00 Luigi Ballabio <
> > > > [hidden email] >:
> > > >
> > > >> Yes, use PiecewiseZeroSpreadedTermStructure instead.
> > > >>
> > > >> Luigi
> > > >>
> > > >>
> > > >> On Wed, Jun 4, 2014 at 11:39 AM, Paolo Baroni <
> > > >> [hidden email] >
> > > >> wrote:
> > > >> > Hi! Is there a way in the function
> > > >> > 'ZeroSpreadedTermStructure'
> > > >> > to pass
> > > >> > it a
> > > >> > z-spread as a vector (set of values for different
> > > >> > maturities)?
> > > >> >
> > > >> > Thanks
> > > >> >
> > > >> > Paolo
> > > >> >
> > > >> >
> > > >> > ------------------------------------------------------------------------------
> > > >> > Learn Graph Databases - Download FREE O'Reilly Book
> > > >> > "Graph Databases" is the definitive new guide to graph
> > > >> > databases
> > > >> > and
> > > >> > their
> > > >> > applications. Written by three acclaimed leaders in the
> > > >> > field,
> > > >> > this first edition is now available. Download your free book
> > > >> > today!
> > > >> > http://p.sf.net/sfu/NeoTech
> > > >> > _______________________________________________
> > > >> > QuantLib-users mailing list
> > > >> > [hidden email]
> > > >> > https://lists.sourceforge.net/lists/listinfo/quantlib-users
> > > >> >
> > > >>
> > > >>
> > > >>
> > > >> --
> > > >> < https://implementingquantlib.blogspot.com >
> > > >> < https://twitter.com/lballabio >
> > > >
> > > >
> > >
> > >
> > >
> > > --
> > > < https://implementingquantlib.blogspot.com >
> > > < https://twitter.com/lballabio >
> > >
> > >
> > > ------------------------------------------------------------------------------
> > > Learn Graph Databases - Download FREE O'Reilly Book
> > > "Graph Databases" is the definitive new guide to graph databases
> > > and
> > > their
> > > applications. Written by three acclaimed leaders in the field,
> > > this first edition is now available. Download your free book
> > > today!
> > > http://p.sf.net/sfu/NeoTech
> > > _______________________________________________
> > > QuantLib-users mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/quantlib-users
> > >
> >
> >
> >
>
>
>

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users