Posted by
Kakhkhor Abdijalilov on
URL: http://quantlib.414.s1.nabble.com/Longstaff-Schwartz-method-SVD-and-OLS-tp8855p8857.html
Let's use numerical rank as cutoff. Only first SVD::rank() singular
values are used, the rest are dropped. We could replace the loop at
line 118 with this one:
for (i=0; i<svd.rank(); ++i) {
const Real u = std::inner_product(U.column_begin(i),
U.column_end(i),
y.begin(), 0.0)/w[i];
for (Size j=0; j<m; ++j) {
a_[j] +=u*V[j][i];
err_[j]+=V[j][i]*V[j][i]/(w[i]*w[i]);
}
}
There is a deeper issue with 2 pass approach (reusing coefficients
from pass 1 in pass 2). It is not critical for equity pricing. I am
looking into the problem right now and planning to write a working
sometime soon.
Regards,
Kakhkhor Abdijalilov.
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev