k[k.length - 1] = n - lastJ;
// now verify probabilities by comparing to integral of pdf
UnivariateRealIntegrator integrator = new RombergIntegrator();
for (int i = 0; i < xs.length - 1; i++) {
double delta = integrator.integrate(new UnivariateRealFunction() {
public double value(double v) {
return dist.pdf(v);
}
}, xs[i], xs[i + 1]);
Assert.assertEquals(delta, p[i + 1], 1.0e-6);