Added liborCap and interpolationMethod to getCloneWithModifiedData
@@ -1310,6 +1310,7 @@ public class LIBORMarketModelFromCovarianceModel extends AbstractProcessModel im
// Fixed at Long LIBOR period Start.
timeIndex = Math.min(timeIndex, getTimeIndex(tenorPeriodStartTime));
if(timeIndex < 0) {
+// timeIndex = -timeIndex-2; // mapping to last known fixing.
throw new IllegalArgumentException("Tenor discretization not part of time discretization.");
}
}
@@ -1629,9 +1630,12 @@ public class LIBORMarketModelFromCovarianceModel extends AbstractProcessModel im
ForwardCurve forwardRateCurve = this.forwardRateCurve;
DiscountCurve discountCurve = this.discountCurve;
LIBORCovarianceModel covarianceModel = this.covarianceModel;
+
Map<String, Object> properties = new HashMap<>();
properties.put("measure", measure.name());
properties.put("stateSpace", stateSpace.name());
+ properties.put("interpolationMethod", interpolationMethod.name());
+ properties.put("liborCap", liborCap);
if(dataModified != null) {
randomVariableFactory = (AbstractRandomVariableFactory)dataModified.getOrDefault("randomVariableFactory", randomVariableFactory);
@@ -1640,7 +1644,6 @@ public class LIBORMarketModelFromCovarianceModel extends AbstractProcessModel im
forwardRateCurve = (ForwardCurve)dataModified.getOrDefault("forwardRateCurve", forwardRateCurve);
discountCurve = (DiscountCurve)dataModified.getOrDefault("discountCurve", discountCurve);
covarianceModel = (LIBORCovarianceModel)dataModified.getOrDefault("covarianceModel", covarianceModel);
- swaptionMarketData = (AbstractSwaptionMarketData)dataModified.getOrDefault("swaptionMarketData", swaptionMarketData);
if(dataModified.containsKey("swaptionMarketData")) {
throw new RuntimeException("Swaption market data as input for getCloneWithModifiedData not supported.");
@@ -1649,10 +1652,6 @@ public class LIBORMarketModelFromCovarianceModel extends AbstractProcessModel im
if(dataModified.containsKey("forwardRateShift")) {
throw new RuntimeException("Forward rate shift clone currently disabled.");
}
- if(dataModified != null && dataModified.containsKey("swaptionMarketData")) {
- swaptionMarketData = (AbstractSwaptionMarketData)dataModified.get("swaptionMarketData");
- }
-
}
LIBORMarketModelFromCovarianceModel newModel = LIBORMarketModelFromCovarianceModel.of(liborPeriodDiscretization, analyticModel, forwardRateCurve, discountCurve, randomVariableFactory, covarianceModel, null, properties);
