Re: questions about pricing American Option in MC method

Posted by Kakhkhor Abdijalilov on
URL: http://quantlib.414.s1.nabble.com/questions-about-pricing-American-Option-in-MC-method-tp8081p8082.html

The payoff function always included into the basis system, even into
monomial system. Yes, including the payoff might improve the accuracy.
Even if the effect negligible, it doesn't hurt anything. Any
collinearity in the basis is taken care off by SVD.

Note to the developers:
I was looking into the file  longstaffschwartzpathpricer.hpp and
noticed that moving vectors x and out of the for loop will avoid
re-allocation.

//--------------Original Code -----
for (Size i=len-2; i>0; --i) {
    std::vector<Real>      y;
    std::vector<StateType> x;

//------------Replace with this ----
std::vector<Real>      y;
std::vector<StateType> x;
for (Size i=len-2; i>0; --i) {
    y.clear();
    x.clear();
//---------------------------------------

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users