[ quantlib-Bugs-3366336 ] Error in Svensson Fitting Formula

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ quantlib-Bugs-3366336 ] Error in Svensson Fitting Formula

SourceForge.net
Bugs item #3366336, was opened at 2011-07-13 22:42
Message generated for change (Settings changed) made by lballabio
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3366336&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: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Wasi (wasix)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error in Svensson Fitting Formula

Initial Comment:
The zerorate calculation of the svensson discount function has an error:

109        Real zeroRate = x[0] + (x[1] + x[2])*
110                        (1.0 - std::exp(-kappa*t))/
111                        ((kappa+QL_EPSILON)*(t+QL_EPSILON)) -
112                        (x[2])*std::exp(-kappa*t) +
113                        x[3]* (((1.0 - std::exp(-kappa*t))/((kappa_1+QL_EPSILON)*(t+QL_EPSILON)))- std::exp(-kappa_1*t));

in line 113 kappa is used instead of kappa_1

correct is this:
109        Real zeroRate = x[0] + (x[1] + x[2])*
110                        (1.0 - std::exp(-kappa*t))/
111                        ((kappa+QL_EPSILON)*(t+QL_EPSILON)) -
112                        (x[2])*std::exp(-kappa*t) +
113                        x[3]* (((1.0 - std::exp(-kappa_1*t))/((kappa_1+QL_EPSILON)*(t+QL_EPSILON)))- std::exp(-kappa_1*t));



----------------------------------------------------------------------

Comment By: Luigi Ballabio (lballabio)
Date: 2011-08-01 14:37

Message:
The bug is now fixed in the Subversion repository.
Thank you for the report.


----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3366336&group_id=12740

------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev