|
From: Andrea <mar...@go...> - 2009-09-26 12:58:14
|
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.
|