Re: Longstaff-Schwartz method, SVD and OLS

Posted by Klaus Spanderen-2 on
URL: http://quantlib.414.s1.nabble.com/Longstaff-Schwartz-method-SVD-and-OLS-tp8855p8863.html

Hi

it's in SVN. Thanks.

On Wednesday 03 November 2010 00:44:06 Kakhkhor Abdijalilov wrote:

> Hi. Similar problem in SVD::solveFor. It uses all singular values to
> compute matrix pseudo-inverse. Insignificant singular values should be
> dropped. Quick fix:
>
>
> Disposable<Array> SVD::solveFor(const Array& b) const{
>     Matrix W(n_, n_, 0.0);
>     Size numericalRank = this->rank();
>     for (Size i=0; i<numericalRank; i++)
>         W[i][i] = 1./s_[i];
>
>     Matrix inverse = V()* W * transpose(U());
>     Array result = inverse * b;
>     return result;
> }
>
>
>
> Also, in SVD::rank  implementation we could replace
> Real eps = std::pow(2.0,-52.0);
> with
> Real eps = QL_EPSILON.
>
>
> Regards,
> Kakhkhor Abdijalilov.
>
> ---------------------------------------------------------------------------
>--- Achieve Improved Network Security with IP and DNS Reputation.
> Defend against bad network traffic, including botnets, malware,
> phishing sites, and compromised hosts - saving your company time,
> money, and embarrassment.   Learn More!
> http://p.sf.net/sfu/hpdev2dev-nov
> _______________________________________________
> QuantLib-dev mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev



------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev