yd.set(i, normal.derivative(x.get(i)));
}
// define the differential operators
final DZero D = new DZero(N,h);
final DPlusMinus D2 = new DPlusMinus(N,h);
// check that the derivative of cum is Gaussian
temp = D.applyTo(yi);
for (i=0; i < y.size(); i++) {
diff.set(i, y.get(i) - temp.get(i));
}
double e = Utilities.norm(diff, h);
if (e > 1.0e-6) {
fail("norm of 1st derivative of cum minus Gaussian: " + e + "\ntolerance exceeded");
}
// check that the second derivative of cum is normal.derivative
temp = D2.applyTo(yi);
for (i=0; i < yd.size(); i++) {
diff.set(i, yd.get(i) - temp.get(i));
}
e = Utilities.norm(diff, h);
if (e > 1.0e-4) {