MillerUpdatingRegression implements UpdatingMultipleLinearRegression { public void addObservations(double[][] x, double[] y) throws ModelSpecificationException { if ((x == null) || (y == null) || (x.length != y.length)) { throw new ModelSpecificationException( LocalizedFormats.DIMENSIONS_MISMATCH_SIMPLE, (x == null) ? 0 : x.length, (y == null) ? 0 : y.length); } if (x.length == 0) { throw new ModelSpecificationException( LocalizedFormats.NO_DATA); } if (x[0].length + 1 > x.length) { throw new ModelSpecificationException( LocalizedFormats.NOT_ENOUGH_DATA_FOR_NUMBER_OF_PREDICTORS, x.length, x[0].length); } for (int i = 0; i < x.length; i++) { addObservation(x[i], y[i]); } } @SuppressWarnings("unused") private  MillerUpdatingRegression();  MillerUpdatingRegression(int numberOfVariables, boolean includeConstant, double errorTolerance);  MillerUpdatingRegression(int numberOfVariables, boolean includeConstant); boolean hasIntercept(); long getN(); void addObservation(final double[] x, final double y); void addObservations(double[][] x, double[] y); void clear(); double[] getPartialCorrelations(int in); double getDiagonalOfHatMatrix(double[] row_data); int[] getOrderOfRegressors(); RegressionResults regress(); RegressionResults regress(int numberOfRegressors); RegressionResults regress(int[] variablesToInclude);  }
@Test public void testNegativeTestAddMultipleObs() { MillerUpdatingRegression instance = new MillerUpdatingRegression(3, true); try { double[][] tst = {{1.0, 1.0, 1.0}, {1.20, 2.0, 2.1}}; double[] y = {1.0}; instance.addObservations(tst, y); Assert.fail("Should throw IllegalArgumentException"); } catch (IllegalArgumentException iae) { } catch (Exception e) { Assert.fail("Should throw IllegalArgumentException"); } try { double[][] tst = {{1.0, 1.0, 1.0}, {1.20, 2.0, 2.1}}; double[] y = {1.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}; instance.addObservations(tst, y); Assert.fail("Should throw IllegalArgumentException"); } catch (IllegalArgumentException iae) { } catch (Exception e) { Assert.fail("Should throw IllegalArgumentException"); } }