diff --git a/src/main/java/org/apache/commons/math3/stat/regression/AbstractMultipleLinearRegression.java b/src/main/java/org/apache/commons/math3/stat/regression/AbstractMultipleLinearRegression.java index 1bf17ded0..fe80fd0b3 100644 --- a/src/main/java/org/apache/commons/math3/stat/regression/AbstractMultipleLinearRegression.java +++ b/src/main/java/org/apache/commons/math3/stat/regression/AbstractMultipleLinearRegression.java @@ -17,10 +17,10 @@ package org.apache.commons.math3.stat.regression; import org.apache.commons.math3.exception.DimensionMismatchException; +import org.apache.commons.math3.exception.InsufficientDataException; import org.apache.commons.math3.exception.MathIllegalArgumentException; import org.apache.commons.math3.exception.NoDataException; import org.apache.commons.math3.exception.NullArgumentException; -import org.apache.commons.math3.exception.NumberIsTooSmallException; import org.apache.commons.math3.exception.util.LocalizedFormats; import org.apache.commons.math3.linear.NonSquareMatrixException; import org.apache.commons.math3.linear.RealMatrix; @@ -109,8 +109,8 @@ public abstract class AbstractMultipleLinearRegression implements * @throws NullArgumentException if the data array is null * @throws DimensionMismatchException if the length of the data array is not equal * to nobs * (nvars + 1) - * @throws NumberIsTooSmallException if nobs is smaller than - * nvars + * @throws InsufficientDataException if nobs is less than + * nvars + 1 */ public void newSampleData(double[] data, int nobs, int nvars) { if (data == null) { @@ -120,7 +120,7 @@ public abstract class AbstractMultipleLinearRegression implements throw new DimensionMismatchException(data.length, nobs * (nvars + 1)); } if (nobs <= nvars) { - throw new NumberIsTooSmallException(nobs, nvars, false); + throw new InsufficientDataException(LocalizedFormats.INSUFFICIENT_OBSERVED_POINTS_IN_SAMPLE, nobs, nvars + 1); } double[] y = new double[nobs]; final int cols = noIntercept ? nvars: nvars + 1;