Login  Register

Some more explanation about LongstaffSchwartz

Posted by andrea-110 on Sep 26, 2009; 12:57pm
URL: http://quantlib.414.s1.nabble.com/Some-more-explanation-about-LongstaffSchwartz-tp13085.html

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