final ISAACRandom rand = new ISAACRandom(10L);// Seed can be changed
final SimpleRegression whole = new SimpleRegression(includeIntercept);// regression of the whole set
final SimpleRegression parts = new SimpleRegression(includeIntercept);// regression with parts.
for (int s = 0; s < sets; s++) {// loop through each subset of data.
final double coef = rand.nextDouble();
final SimpleRegression sub = new SimpleRegression(includeIntercept);// sub regression
for (int i = 0; i < 5; i++) { // loop through individual samlpes.
final double x = rand.nextDouble();
final double y = x * coef + rand.nextDouble();// some noise
sub.addData(x, y);