Closed NiklasRodi closed 7 years ago
I do not understand the change. Maybe I have to look more closely,.... but:
model = model.addCurves(forwardCurve);
has been removed.IllegalArgumentException("Cannot create forwardCurve " + forwardCurveName + " as no such curve was found in the model...
does not make sense to me. In case he cannot find a forward curve he should create a ForwardCurve?.Confused.
(I though that the unit test should fail with this code, I have to check...)
Also: Why was
private static final boolean isUseForwardCurve;
static {
// Default value is true
isUseForwardCurve = Boolean.parseBoolean(System.getProperty("net.finmath.marketdata.calibration.CalibratedCurves.isUseForwardCurve","true"));
}
removed. What about the situations where only likes to switch between the two approaches?
I don't like the feature that a forwardCurve is always created, even if the given forwardCurveName was not found in the model at all. What if I have already added a forwardCurve to my model that is almost "empty" but has e.g. a specific Interpolation method. Now I want to calibrate that curve but have a typo in the forwardCurveName such that it is not found in the model. Instead of getting an exception and being able to correct the name I will get some default forwardCurve that has not the interpolation method I wanted. This error will be very nasty to find. Maybe there are even worse problems.
I prefer the solution where the forwardCurve has to be created outside modulo maybe the wrapping feature (i.e. at least a Discount curve to base my forward curve on has to be created outside). I admit that the wrapping is the only feature left in the function (so maybe one should use a different name?). However, at one point I would also like to get rid of that internal wrapping (again it should be done outside) making the method totally redundant, i.e. at that point I would delete it for good.
OK. Now I understand your intention. But...
... let me check....
Closed as (partially) implemented in commit d2c95c4
What is this PR for?
What type of PR is it?
Feature