Login  Register

Re: Re: swaps

Posted by Ilja Chagalov on Jun 20, 2002; 5:21am
URL: http://quantlib.414.s1.nabble.com/swaps-tp2084p2086.html

Hi everybody!

If you try to compute zero yields with the constant 4% term structure in the
Jens's example
(TermStructure is fed with four DepositRateHelpers: 1w, 1y, 5y, 10y and the
rate is set to 4% everywhere) ...

  for(double t=1.0; t<=9.0;t+=1.0)
   std::cout <<  "zeroYield(" << t << ") ="
    << RateFormatter::toString(depoSwapTermStructure->zeroYield(t), 4)
    << std::endl;

... you get the following results:

zeroYield(1) =3.9755%
zeroYield(2) =3.7999%
zeroYield(3) =3.7413%
zeroYield(4) =3.7121%
zeroYield(5) =3.6945%
zeroYield(6) =3.5983%
zeroYield(7) =3.5296%
zeroYield(8) =3.4781%
zeroYield(9) =3.4380%

I get similar results using act/365 day counter.
In my understanding it should be appr. =4% everywhere, but it looks
different.
Why is it so? Why is the zero yield going down as t inscreases?

Greetings,
Ilja


----- Original Message -----
From: "Ferdinando Ametrano" <[hidden email]>
To: "Jens Thiel" <[hidden email]>;
<[hidden email]>
Cc: <[hidden email]>
Sent: Wednesday, June 19, 2002 7:07 PM
Subject: Re: [Quantlib-users] swaps


> Hi Jens
>
> you wrote:
> >I take the swapvaluation example and assume:
> >
> >- termstructure with constant 4% rates
> >- 2 year swap, 4% fixed rate, spread 0.0
> >
> >and get the following results:
> >
> >   *** 2Y swap at 4.00%
> >   *** using constant 4% structure:
> >   2Y 4.00% NPV:               2346.70
> >   2Y 4.00% fair spread:          0.1228%
> >   2Y fair fixed rate:             3.8760%
> >
> >Can somebody explain that to me?
> I'm sorry I cannot double check your example right now, but you might be
> paying too little attention to the daycount and compounding conventions.
> The 4% rate of a QuantLib term structure is continuos compounding:
> discount(t)=QL_EXP(0.04*t)
> and the time is measured with the daycount you provided as input (usually
> something smooth as act/365, not 30/360)
> The 4% fixed rate of a 2 year swap is simple compounding:
> cashflow=0.04*Nominal*t, and the time is measured with the daycount you
> provided as input (usually 30/360)
> This could easily account for the numerical results you provided.
>
> It would be different if you bootstrapped a term structure with a 2 year
> swap, 4% fixed rate and then the bootstrapped yield curve wouldn't
re-price

> the same swap at 4%.
> This would be a real problem.
>
> Hope this helps. If not, please let me know and I'll go into the actual
> calculations
>
> ciao -- Nando
>
>
>