I am new to the quant finance community...

I have a series of bond cash flows, its market prices and also the spot rates for the timing of those cash flows. How to find the Z-Spread that matches its market price in R?

I have written a brute force code starting the Z-spread from zero and increasing it until the price equals market price. Is there any easy method than this?

I have 2000 bonds and I have to calculate Z-Spreads for all them...and running this brute force code for all them.. It takes 10 hourss..

How to simplify this...

Thank you in advance.

  • 1
    $\begingroup$ So mathematically the problem is to find z such that $P=\sum_i C_i e^{-(r_i+z)t_i}$ ? $\endgroup$ – noob2 Sep 30 '16 at 19:23
  • $\begingroup$ An obvious optimization would be to not increase the spread slowly, but to use some kind of bisection method. en.m.wikipedia.org/wiki/Bisection_method. It's easy to implement and should speed up your calculation by multiples. $\endgroup$ – Ami44 Oct 1 '16 at 17:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.