Bugs item #2691647, was opened at 2009-03-18 12:16
Message generated for change (Tracker Item Submitted) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=2691647&group_id=12740 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Problems in calculating the ParRates Initial Comment: Dear ladies and gentlemen, when considering the example "FittedBondCurve.cpp" I found the behavior of the function "parRates" to be strange. The parRate is defined as the fixed rate for which the instrument is noted at par. This means that the CLEAN price equals the notional, say 1. The net present value of future cashflows, however, equals the DIRTY price. For the purpuse of calculating the Par Yield Curve, which is most interesting, yearly coupons and annual compounding is to be assumed in order to calculate the theoretically correct accrued amount (Hans-Peter Deutsch, Derivate und Interne Modelle, 3. Ed., p. 74,75). Thus, I coded a solution c to (1+c)^(t-t_m) = Sum_{i=m+1}^{n} df(t,t_i)*c(t_i-t_{i-1}) + df(t,t_n), (1) instead of 1 = Sum_{i=m+1}^{n} df(t,t_i)*c(t_i-t_{i-1}) + df(t,t_n), (2) where t is today, t_m < t < t_{m+1} < ... < t_n, t_i are the coupon dates, df(t,t_i) the corresponding discount factors and c the coupons. Eq. (1) follows from (6.6) in [H. P. Deutsch] with (6.5), annual compounding (table 3.4) and N(t_m)=N(t_n)=1. Eq. (2) is correct only at the coupon dates, but not in between. - For the solution of (1) I did Taylor-series approximation and solved the quadratic equation. This should be improved by some iterative scheme like Regula Falsi or Newton. - Presumably at the 29.2. for some curves there were small jumps. Thus maybe I did not completely correct implement the elapsed time since the last coupon payment. - Further it would be a good thing to have a possibility to get the Par Yield Curve without having to calculate the coupon dates (which I did in main). Just transferring the date like for the "zeroRate" would be much more convenient, i.e. to call e.g. "ts3->parRate(date)" The resulting figure shows a reasonable behavior. The Par Yield Curve fits to the coupons, i.e. parRates of the underlying data points. The Par Yield Curve is above the zero curve for a falling zero structure as expected (and vice versa for an increasing zero structure). I would be interested in and happy about a new release including the calculation of Par Yield Curves as proposed. Best regards, Karl Riedel Nagler & Company GmbH ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=2691647&group_id=12740 ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Free forum by Nabble | Edit this page |