|
From: Kakhkhor A. <kab...@gm...> - 2010-10-28 18:52:34
|
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.
|