@@ -443,13 +443,13 @@ RandomVariable LgmVectorised::averagedOnRate(const boost::shared_ptr<OvernightIn
443443 std::swap (cap, floor);
444444 }
445445
446- if (nakedOption)
447- rate = RandomVariable (x.size (), 0.0 );
448-
449446 RandomVariable forwardRate = (rate - RandomVariable (x.size (), spread)) / RandomVariable (x.size (), gearing);
450447 RandomVariable floorletRate (x.size (), 0.0 );
451448 RandomVariable capletRate (x.size (), 0.0 );
452449
450+ if (nakedOption)
451+ rate = RandomVariable (x.size (), 0.0 );
452+
453453 if (floor != Null<Real>()) {
454454 // ignore localCapFloor, treat as global
455455 RandomVariable effectiveStrike = RandomVariable (x.size (), (floor - spread) / gearing);
@@ -560,13 +560,13 @@ RandomVariable LgmVectorised::averagedBmaRate(const boost::shared_ptr<BMAIndex>&
560560 std::swap (cap, floor);
561561 }
562562
563- if (nakedOption)
564- avgBMA = RandomVariable (x.size (), 0.0 );
565-
566563 RandomVariable forwardRate = (avgBMA - RandomVariable (x.size (), spread)) / RandomVariable (x.size (), gearing);
567564 RandomVariable floorletRate (x.size (), 0.0 );
568565 RandomVariable capletRate (x.size (), 0.0 );
569566
567+ if (nakedOption)
568+ avgBMA = RandomVariable (x.size (), 0.0 );
569+
570570 if (floor != Null<Real>()) {
571571 // ignore localCapFloor, treat as global
572572 RandomVariable effectiveStrike = RandomVariable (x.size (), (floor - spread) / gearing);
0 commit comments