Curve Calibration Reports Converge Error when Curve Type Set to DF(Discount Factor )

Thanks for the great work for Strata.
I’m running the example SwapPricingWithCalibrationExample for some validations.
The original setting is like:

Curve Name,Value Type,Day Count,Interpolator,Left Extrapolator,Right Extrapolator

I want to see the calibrated curve in the form with discount factors instead of zero rate and I assume changing the ‘Type’ from Zero to DF would suffice.

Curve Name,Value Type,Day Count,Interpolator,Left Extrapolator,Right Extrapolator

However, when I run the example with this updated setting, the program complains like:

[main] INFO com.opengamma.strata.math.impl.rootfinding.newton.BaseNewtonVectorRootFinder - Failed to converge in backtracking, even after a Jacobian recalculation.Final position:[0.9989421052247818, 0.9980665652046564, 0.9972072722570962, 0.9935189049487357]
last deltaX:[-2.3933814792120896E-9, -1.0027323018698439E-9, -8.948817368652821E-10, 4.3119719939604865E-9]
function value:[-0.01109, 1.6629957842878573E-6, 1.255129442271491E-7, 2.0052499361835306E-6]
0.0 0.0 0.0 0.0
3.9206237486359328 -3.9240630613185297 0.0 0.0
0.0 3.8405127405199786 -3.843822108195842 0.0
1.0042250407892157 -0.002673249694639651 -0.03310632002601799 -0.9737919704578374

I changed several interpolators and none of them works.
Am I misunderstanding what the ‘Type’ really means?

I might find where the problem is. I debugged and found that the Flat Extrapolator would be the cause.
Say I have a 3m libor fixing deposit trade which starts at 2020/4/21, effective at 4/23 and mature at 7/23;
7/23 is the first node on curve; when getting the df on 4/23, extrapolator comes in, thus obtaining same df on 4/23 and 7/23 which then cause the disaster.
I changed to the Linear, however I got another Error:

Exception in thread “main” com.opengamma.strata.math.MathException: Cannot work with this starting >position. Please choose another point

yet another error again for LogLinear:

Exception in thread “main” java.lang.IllegalArgumentException: Argument ‘amount’ must not be NaN
at com.opengamma.strata.collect.ArgChecker.notNaN(
at com.opengamma.strata.basics.currency.CurrencyAmount.(
at com.opengamma.strata.basics.currency.CurrencyAmount.of(
at com.opengamma.strata.pricer.swap.DiscountingSwapProductPricer.presentValue(
at com.opengamma.strata.pricer.swap.DiscountingSwapProductPricer.parSpread(
at com.opengamma.strata.pricer.curve.TradeCalibrationMeasure.lambda$static$4(
at com.opengamma.strata.pricer.curve.TradeCalibrationMeasure.value(
at com.opengamma.strata.pricer.curve.CalibrationMeasures.value(
at com.opengamma.strata.pricer.curve.CalibrationValue.lambda$apply$0(
at java.base/java.util.Arrays.setAll(
at com.opengamma.strata.collect.array.DoubleArray.of(
at com.opengamma.strata.pricer.curve.CalibrationValue.apply(
at com.opengamma.strata.pricer.curve.CalibrationValue.apply(
at com.opengamma.strata.math.impl.rootfinding.newton.BaseNewtonVectorRootFinder.updatePosition(
at com.opengamma.strata.math.impl.rootfinding.newton.BaseNewtonVectorRootFinder.getNextPosition(
at com.opengamma.strata.math.impl.rootfinding.newton.BaseNewtonVectorRootFinder.findRoot(
at com.opengamma.strata.pricer.curve.RatesCurveCalibrator.calibrateGroup(
at com.opengamma.strata.pricer.curve.RatesCurveCalibrator.calibrate(
at com.opengamma.strata.pricer.curve.RatesCurveCalibrator.calibrate(

I wish someone could save me from here, thanks a lot.

We’d have to see the other two config files to fully understand the issue. However calibration is sensitive to the interpolator and extrapolators as you’ve found. We have a test case that uses CurveInterpolators.LOG_LINEAR, CurveExtrapolators.EXPONENTIAL, CurveExtrapolators.EXPONENTIAL with discount factors, so that might be worth a try.

Many thanks for your reply.
As for this case, the other two config files, Group and Nodes, make no contribution to this problem, as they just tell what a curve consists of . The Type filed in the setting config just controls the output form of the same curve, whether in discount factors or in zero rates, both describing the same curve underlying. If we can successfully build a zero rate curve, why not a discount factor curve, because they are interchangeable. So there might be some enhancements could be done to resolve this problem?
Could you please bother naming the test case Java class you mentioned above?