Added method getForwardDiscountBond(double time, double maturity)
To allow AAD compatible deterministic discounting.
@@ -349,6 +349,13 @@ public class HullWhiteModel extends AbstractProcessModel implements ShortRateMod
return numeraire;
}
+ public RandomVariable getForwardDiscountBond(double time, double maturity) throws CalculationException {
+ RandomVariable inverseForwardBondAsOfTime = getLIBOR(time, time, maturity).mult(maturity-time).add(1.0);
+ RandomVariable inverseForwardBondAsOfZero = getLIBOR(0.0, time, maturity).mult(maturity-time).add(1.0);
+ RandomVariable forwardDiscountBondAsOfZero = getDiscountFactorFromForwardCurve(maturity).div(getDiscountFactorFromForwardCurve(time));
+ return forwardDiscountBondAsOfZero.mult(inverseForwardBondAsOfZero).div(inverseForwardBondAsOfTime);
+ }
+
@Override
public RandomVariable[] getDrift(int timeIndex, RandomVariable[] realizationAtTimeIndex, RandomVariable[] realizationPredictor) {
@@ -946,5 +953,4 @@ public class HullWhiteModel extends AbstractProcessModel implements ShortRateMod
+ ", isInterpolateDiscountFactorsOnLiborPeriodDiscretization="
+ isInterpolateDiscountFactorsOnLiborPeriodDiscretization + "]";
}
-
}
