A clarification about AmericanBasketPathPricer

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

A clarification about AmericanBasketPathPricer

andrea-110
This code in the constructor of AmericanBasketPathPricer in
ql/pricingengines/basket/mcamericanbasketengine.cpp

is a little misleading.

         const boost::shared_ptr<BasketPayoff> basketPayoff
             = boost::dynamic_pointer_cast<BasketPayoff>(payoff_);
         QL_REQUIRE(basketPayoff, "payoff not a basket payoff");

         const boost::shared_ptr<StrikedTypePayoff> strikePayoff
             = boost::dynamic_pointer_cast<StrikedTypePayoff>(basketPayoff->basePayoff());
         QL_REQUIRE(basketPayoff, "payoff not a basket strike payoff");
                   ^^^^^^^^^^^^
///////////// we have already checked that basketPayoff is non null a few lines above
///////////// should it be strikePayoff????

         if (strikePayoff) {
             ^^^^^^^^^^^^
///////////// and in that case, why is there an if?

             scalingValue_/=strikePayoff->strike();
         }

Cheers


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: A clarification about AmericanBasketPathPricer

Klaus Spanderen-2
Hi

> QL_REQUIRE(basketPayoff, "payoff not a basket strike payoff"); ^^^^^^^^^^^^
> ///////////// we have already checked that basketPayoff is non null a few
> lines above ///////////// should it be strikePayoff????

thanks for the hint, you are right this QL_REQUIRE is useless. Luigi has
already removed it from the current version.

>          if (strikePayoff) {
>              ^^^^^^^^^^^^
> ///////////// and in that case, why is there an if?
>
>              scalingValue_/=strikePayoff->strike();
>          }
>

If the basketPayoff is a StrikedTypePayoff the strike is used as a "scale" to
normalize the state variables (e.g. the underlying prices) to improve the
quality of the regression (improvement depends on the choice of the basis
system). The idea behind this normalization step is explained in

Longstaff and Schwartz: Valuing American options by simulation: a
least-squares approach,

in section 8.3.

regards
 Klaus

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev