final SABRFormulaData[] modelParams = new SABRFormulaData[n - 2];
final double[] errors = new double[n];
Arrays.fill(errors, 0.0001); //1bps
final SmileModelFitter<SABRFormulaData> globalFitter = new SABRModelFitter(forward, strikes, expiry, impliedVols, errors, MODEL);
final BitSet fixed = new BitSet();
if (n == 3 || !_globalBetaSearch) {
fixed.set(1); //fixed beta
}
//do a global fit first
final LeastSquareResultsWithTransform gRes = globalFitter.solve(start, fixed);
if (n == 3) {
if (gRes.getChiSq() / n > 1.0) {
s_logger.warn("chi^2 on SABR fit to ", +n + " points is " + gRes.getChiSq());
}