final double forward = volatilityCubeData.getATMStrikes().get(tenorPair);
for (int k = 0; k < n; k++) {
errors[k] = ERROR;
}
if (strikes.length > 4 && forward > 0) { //don't fit those smiles with insufficient data
final LeastSquareResultsWithTransform fittedResult = new SABRModelFitter(forward, strikes, swaptionExpiry, blackVols, errors, SABR_FUNCTION).solve(SABR_INITIAL_VALUES, FIXED);
final DoubleMatrix1D parameters = fittedResult.getModelParameters();
swapMaturitiesList.add(maturity);
swaptionExpiriesList.add(swaptionExpiry);
alphaList.add(parameters.getEntry(0));
betaList.add(parameters.getEntry(1));
rhoList.add(parameters.getEntry(2));
nuList.add(parameters.getEntry(3));
final DoublesPair expiryMaturityPair = new DoublesPair(swaptionExpiry, maturity);
inverseJacobians.put(expiryMaturityPair, fittedResult.getModelParameterSensitivityToData());
chiSqList.add(fittedResult.getChiSq());
fittedSmileIds.put(tenorPair, externalIds);
fittedRelativeStrikes.put(tenorPair, relativeStrikes);
}
}
}