Java Code Examples for org.apache.commons.math3.exception.util.LocalizedFormats#NO_DATA

The following examples show how to use org.apache.commons.math3.exception.util.LocalizedFormats#NO_DATA . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MillerUpdatingRegression.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds multiple observations to the model.
 * @param x observations on the regressors
 * @param y observations on the regressand
 * @throws ModelSpecificationException if {@code x} is not rectangular, does not match
 * the length of {@code y} or does not contain sufficient data to estimate the model
 */
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) {  // Must be no y data either
        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]);
    }
}
 
Example 2
Source File: MillerUpdatingRegression.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds multiple observations to the model.
 * @param x observations on the regressors
 * @param y observations on the regressand
 * @throws ModelSpecificationException if {@code x} is not rectangular, does not match
 * the length of {@code y} or does not contain sufficient data to estimate the model
 */
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) {  // Must be no y data either
        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]);
    }
}
 
Example 3
Source File: MillerUpdatingRegression.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds multiple observations to the model.
 * @param x observations on the regressors
 * @param y observations on the regressand
 * @throws ModelSpecificationException if {@code x} is not rectangular, does not match
 * the length of {@code y} or does not contain sufficient data to estimate the model
 */
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) {  // Must be no y data either
        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]);
    }
}
 
Example 4
Source File: MillerUpdatingRegression.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds multiple observations to the model.
 * @param x observations on the regressors
 * @param y observations on the regressand
 * @throws ModelSpecificationException if {@code x} is not rectangular, does not match
 * the length of {@code y} or does not contain sufficient data to estimate the model
 */
public void addObservations(double[][] x, double[] y) {
    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) {  // Must be no y data either
        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]);
    }
}
 
Example 5
Source File: MillerUpdatingRegression.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds multiple observations to the model.
 * @param x observations on the regressors
 * @param y observations on the regressand
 * @throws ModelSpecificationException if {@code x} is not rectangular, does not match
 * the length of {@code y} or does not contain sufficient data to estimate the model
 */
public void addObservations(double[][] x, double[] y) {
    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) {  // Must be no y data either
        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]);
    }
}
 
Example 6
Source File: MillerUpdatingRegression.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds multiple observations to the model
 * @param x observations on the regressors
 * @param y observations on the regressand
 * @throws ModelSpecificationException if {@code x} is not rectangular, does not match
 * the length of {@code y} or does not contain sufficient data to estimate the model
 */
public void addObservations(double[][] x, double[] y) {
    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) {  // Must be no y data either
        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++) {
        this.addObservation(x[i], y[i]);
    }
    return;
}
 
Example 7
Source File: MillerUpdatingRegression.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds multiple observations to the model.
 * @param x observations on the regressors
 * @param y observations on the regressand
 * @throws ModelSpecificationException if {@code x} is not rectangular, does not match
 * the length of {@code y} or does not contain sufficient data to estimate the model
 */
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) {  // Must be no y data either
        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]);
    }
}
 
Example 8
Source File: DescriptiveStatistics.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Removes the most recent value from the dataset.
 *
 * @throws MathIllegalStateException if there are no elements stored
 */
public void removeMostRecentValue() throws MathIllegalStateException {
    try {
        eDA.discardMostRecentElements(1);
    } catch (MathIllegalArgumentException ex) {
        throw new MathIllegalStateException(LocalizedFormats.NO_DATA);
    }
}
 
Example 9
Source File: DescriptiveStatistics.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Removes the most recent value from the dataset.
 *
 * @throws MathIllegalStateException if there are no elements stored
 */
public void removeMostRecentValue() throws MathIllegalStateException {
    try {
        eDA.discardMostRecentElements(1);
    } catch (MathIllegalArgumentException ex) {
        throw new MathIllegalStateException(LocalizedFormats.NO_DATA);
    }
}
 
Example 10
Source File: DescriptiveStatistics.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Removes the most recent value from the dataset.
 *
 * @throws MathIllegalStateException if there are no elements stored
 */
public void removeMostRecentValue() throws MathIllegalStateException {
    try {
        eDA.discardMostRecentElements(1);
    } catch (MathIllegalArgumentException ex) {
        throw new MathIllegalStateException(LocalizedFormats.NO_DATA);
    }
}
 
Example 11
Source File: DescriptiveStatistics.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Removes the most recent value from the dataset.
 *
 * @throws MathIllegalStateException if there are no elements stored
 */
public void removeMostRecentValue() throws MathIllegalStateException {
    try {
        eDA.discardMostRecentElements(1);
    } catch (MathIllegalArgumentException ex) {
        throw new MathIllegalStateException(LocalizedFormats.NO_DATA);
    }
}
 
Example 12
Source File: DescriptiveStatistics.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Removes the most recent value from the dataset.
 *
 * @throws MathIllegalStateException if there are no elements stored
 */
public void removeMostRecentValue() throws MathIllegalStateException {
    try {
        eDA.discardMostRecentElements(1);
    } catch (MathIllegalArgumentException ex) {
        throw new MathIllegalStateException(LocalizedFormats.NO_DATA);
    }
}
 
Example 13
Source File: DescriptiveStatistics.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Removes the most recent value from the dataset.
 *
 * @throws MathIllegalStateException if there are no elements stored
 */
public void removeMostRecentValue() throws MathIllegalStateException {
    try {
        eDA.discardMostRecentElements(1);
    } catch (MathIllegalArgumentException ex) {
        throw new MathIllegalStateException(LocalizedFormats.NO_DATA);
    }
}
 
Example 14
Source File: NoDataException.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Construct the exception.
 */
public NoDataException() {
    this(LocalizedFormats.NO_DATA);
}
 
Example 15
Source File: NoDataException.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Construct the exception.
 */
public NoDataException() {
    this(LocalizedFormats.NO_DATA);
}
 
Example 16
Source File: NoDataException.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Construct the exception.
 */
public NoDataException() {
    this(LocalizedFormats.NO_DATA);
}
 
Example 17
Source File: NoDataException.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Construct the exception.
 */
public NoDataException() {
    this(LocalizedFormats.NO_DATA);
}
 
Example 18
Source File: NoDataException.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Construct the exception.
 */
public NoDataException() {
    this(LocalizedFormats.NO_DATA);
}
 
Example 19
Source File: NoDataException.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Construct the exception.
 */
public NoDataException() {
    this(LocalizedFormats.NO_DATA);
}
 
Example 20
Source File: NoDataException.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Construct the exception.
 */
public NoDataException() {
    this(LocalizedFormats.NO_DATA);
}