Some more explanation about LongstaffSchwartz

View: New views
2 Messages — Rating Filter:   Alert me  

Some more explanation about LongstaffSchwartz

by Andrea-60 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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® 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-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
QuantLib-dev mailing list
QuantLib-dev@...
https://lists.sourceforge.net/lists/listinfo/quantlib-dev

Re: Some more explanation about LongstaffSchwartz

by Klaus Spanderen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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® 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-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
QuantLib-dev mailing list
QuantLib-dev@...
https://lists.sourceforge.net/lists/listinfo/quantlib-dev