[ quantlib-Bugs-1662397 ] Error in BermudanSwaption Example?

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

[ quantlib-Bugs-1662397 ] Error in BermudanSwaption Example?

SourceForge.net
Bugs item #1662397, was opened at 2007-02-17 17:21
Message generated for change (Comment added) made by lballabio
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112740&aid=1662397&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: Invalid
Priority: 5
Private: No
Submitted By: Bert (tbms1)
>Assigned to: Luigi Ballabio (lballabio)
Summary: Error in BermudanSwaption Example?

Initial Comment:
Hi,
I suppose there could be an error in BermudanSwaption.cpp of the examples (see around lines 175)

        for (i=0; i<numRows; i++) {
            Size j = numCols - i -1; // 1x5, 2x4, 3x3, 4x2, 5x1
//This causes j to have the values: 4,3,2,1,0
//I guess this is not what is supposed to happen when the period is set to 4,3,2,1,0 4 lines below

            Size k = i*numCols + j;
            boost::shared_ptr<Quote> vol(new SimpleQuote(swaptionVols[k]));
            swaptions.push_back(boost::shared_ptr<CalibrationHelper>(new
                SwaptionHelper(swaptionMaturities[i],
                               Period(swapLenghts[j], Years),
                               Handle<Quote>(vol),
                               indexSixMonths,
                               indexSixMonths->tenor(),
                               indexSixMonths->dayCounter(),
                               indexSixMonths->dayCounter(),
                               rhTermStructure)));
            swaptions.back()->addTimesTo(times);
        }



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

>Comment By: Luigi Ballabio (lballabio)
Date: 2007-11-26 15:31

Message:
Logged In: YES
user_id=75450
Originator: NO

No, this is correct. j is used to index into swapLenghts (defined earlier
in the file) so that for j = { 4,3,2,1,0 } the periods are { 5Y, 4Y, 3Y,
2Y, 1Y }. These combine with the maturities to yield the diagonal of the
swaption matrix.

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

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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev