Some more explanation about LongstaffSchwartz

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Some more explanation about LongstaffSchwartz

andrea-110
In ql/methods/montecarlo/longstaffschwartz.hpp at around line 155 there is the following code

             else {
             // if number of itm paths is smaller then the number of
             // calibration functions -> no early exercise
                 coeff_[i] = Array(v_.size(), 0.0);
             }

The array of coefficients is used at around line 113 & 164.
These are coefficients of a linear combination of basis functions

                     Real continuationValue = 0.0;
                     for (Size l=0; l<v_.size(); ++l) {
                         continuationValue += coeff_[i][l] * v_[l](x[k]);
                     }

so that if the array is full of 0.0, the continuation value is 0.0 as well.
Then, the check is

                     if (continuationValue < exercise[j]) {
                         prices[j] = exercise[j];
                     }

which implies exactly the opposite of what the comment says (exercise[j] is > 0.0)

This is not very important because it only happens for paths where the exercise is positive which
were anyway very few.

I just find the comment misleading.


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Some more explanation about LongstaffSchwartz

Klaus Spanderen-2
Hi

On Saturday 26 September 2009 14:57:41 Andrea wrote:
>
> which implies exactly the opposite of what the comment says (exercise[j] is
> > 0.0)


opps, the comment is misleading (or simply wrong;-). I'm going to remove the
comment. Thanks!

regards
 Klaus

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev