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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev