final int[] nKnots = new int[] {8, 20 };
final int[] degree = new int[] {3, 3 };
final int[] diff = new int[] {2, 2 };
final double[] lambda = new double[] {0.1, 0.3 };
final PSplineFitter splineFitter = new PSplineFitter();
final GeneralizedLeastSquareResults<double[]> res = splineFitter.solve(tk, vols, sigmas, new double[] {0.0, 0.0 }, new double[] {2.0, 3.0 }, nKnots, degree, lambda, diff);
System.out.println(res.getChiSq());
final Function1D<double[], Double> func = res.getFunction();
final Function<Double, Double> temp2 = new Function<Double, Double>() {