http://quantlib.414.s1.nabble.com/YieldCurve-from-discount-factors-tp7795p7799.html
> -----Original Message-----
> From: Cliffy [mailto:
[hidden email]]
> Sent: mercoledì, 18. novembre 2009 21:02
> To:
[hidden email]
> Subject: Re: [Quantlib-users] YieldCurve from discount factors
>
>
> Hi, I am new to quantlib, read this post and out of curiosity want to
> try it
> out.
> I thought the usage of "InterpolatedDiscountCurve" is to provide a set
> of
> "discount factors" and
> be able to calculate par rates on the curve.
>
> I use a simple unrealistic discount curve (to 30 days) -
>
> Date Disc factor
>
> Sep 23 1
> Oct 1 0.995
> Nov 3 0.992
>
> try to calculate par rate as of Oct 1, I got
>
> 0.0050251256281407079
>
> it seemd to be too small, shouldn't be around 20%??
>
> here are the codes,
>
> vector<Date> dates;
> vector<DiscountFactor> rates;
> vector<Date> datesIn;
>
> DayCounter termStructureDayCounterX = Actual360();;
> Calendar calendarX = TARGET();
>
> Date settlementDateX(22, September, 2004);
> Date d1 = calendarX.advance(settlementDateX, 1,Days);
> dates.push_back(d1);
> d1 = calendarX.advance(settlementDateX, 7,Days);
> dates.push_back(d1);
> d1 = calendarX.advance(settlementDateX, 30,Days);
> dates.push_back(d1);
> Rate r1 = 1;
> rates.push_back(r1);
> r1 = 0.995;
> rates.push_back(r1);
> r1 = 0.992;
> rates.push_back(r1);
>
> Handle<YieldTermStructure>
> refTermStructure(boost::shared_ptr<YieldTermStructure>(
> new InterpolatedDiscountCurve<LogLinear>(dates, rates,
> termStructureDayCounterX)));
>
> d1 = calendarX.advance(settlementDateX, 1,Days);
> datesIn.push_back(d1);
> d1 = calendarX.advance(settlementDateX, 7,Days);
> datesIn.push_back(d1);
>
> Rate r2;
> r2 = refTermStructure->parRate(datesIn,Annual,true);
>
> cout << r2; // r2 = 0.0050251256281407079
>
> What did I do wrong here??
>
> Regards,
>
> Cliff
>
> --
> View this message in context:
http://old.nabble.com/YieldCurve-from-> discount-factors-tp26375800p26414696.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
>
> -----------------------------------------------------------------------
> -------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day
> trial. Simplify your report design, integration and deployment - and
> focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.
http://p.sf.net/sfu/bobj-july> _______________________________________________
> QuantLib-users mailing list
>
[hidden email]
>
https://lists.sourceforge.net/lists/listinfo/quantlib-userstrial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.