Using scalar in indicator function values.
@@ -9,6 +9,7 @@ import net.finmath.exception.CalculationException;
import net.finmath.montecarlo.RandomVariableFromDoubleArray;
import net.finmath.montecarlo.interestrate.LIBORModelMonteCarloSimulationModel;
import net.finmath.stochastic.RandomVariable;
+import net.finmath.stochastic.Scalar;
/**
* Implements the valuation of a digital caplet using a given
@@ -65,8 +66,8 @@ public class DigitalCaplet extends AbstractLIBORMonteCarloProduct {
// Get random variables
final RandomVariable libor = model.getLIBOR(optionMaturity, periodStart, periodEnd);
- final RandomVariable trigger = libor.sub(strike).mult(periodLength);
- RandomVariable values = trigger.choose((new RandomVariableFromDoubleArray(periodLength)), (new RandomVariableFromDoubleArray(0.0)));
+ final RandomVariable trigger = libor.sub(strike);
+ RandomVariable values = trigger.choose((new Scalar(periodLength)), (new Scalar(0.0)));
// Get numeraire and probabilities for payment time
final RandomVariable numeraire = model.getNumeraire(paymentDate);
