Java Code Examples for org.apache.commons.math.exception.util.LocalizedFormats#STANDARD_DEVIATION

The following examples show how to use org.apache.commons.math.exception.util.LocalizedFormats#STANDARD_DEVIATION . 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: Math_60_NormalDistributionImpl_s.java    From coming with MIT License 3 votes vote down vote up
/**
 * Create a normal distribution using the given mean, standard deviation and
 * inverse cumulative distribution accuracy.
 *
 * @param mean Mean for this distribution.
 * @param sd Standard deviation for this distribution.
 * @param inverseCumAccuracy Inverse cumulative probability accuracy.
 * @throws NotStrictlyPositiveException if {@code sd <= 0}.
 * @since 2.1
 */
public NormalDistributionImpl(double mean, double sd, double inverseCumAccuracy) {
    if (sd <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.STANDARD_DEVIATION, sd);
    }

    this.mean = mean;
    standardDeviation = sd;
    solverAbsoluteAccuracy = inverseCumAccuracy;
}
 
Example 2
Source File: Math_60_NormalDistributionImpl_t.java    From coming with MIT License 3 votes vote down vote up
/**
 * Create a normal distribution using the given mean, standard deviation and
 * inverse cumulative distribution accuracy.
 *
 * @param mean Mean for this distribution.
 * @param sd Standard deviation for this distribution.
 * @param inverseCumAccuracy Inverse cumulative probability accuracy.
 * @throws NotStrictlyPositiveException if {@code sd <= 0}.
 * @since 2.1
 */
public NormalDistributionImpl(double mean, double sd, double inverseCumAccuracy) {
    if (sd <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.STANDARD_DEVIATION, sd);
    }

    this.mean = mean;
    standardDeviation = sd;
    solverAbsoluteAccuracy = inverseCumAccuracy;
}
 
Example 3
Source File: NormalDistributionImpl_s.java    From coming with MIT License 3 votes vote down vote up
/**
 * Create a normal distribution using the given mean, standard deviation and
 * inverse cumulative distribution accuracy.
 *
 * @param mean Mean for this distribution.
 * @param sd Standard deviation for this distribution.
 * @param inverseCumAccuracy Inverse cumulative probability accuracy.
 * @throws NotStrictlyPositiveException if {@code sd <= 0}.
 * @since 2.1
 */
public NormalDistributionImpl(double mean, double sd, double inverseCumAccuracy) {
    if (sd <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.STANDARD_DEVIATION, sd);
    }

    this.mean = mean;
    standardDeviation = sd;
    solverAbsoluteAccuracy = inverseCumAccuracy;
}
 
Example 4
Source File: NormalDistributionImpl_t.java    From coming with MIT License 3 votes vote down vote up
/**
 * Create a normal distribution using the given mean, standard deviation and
 * inverse cumulative distribution accuracy.
 *
 * @param mean               Mean for this distribution.
 * @param sd                 Standard deviation for this distribution.
 * @param inverseCumAccuracy Inverse cumulative probability accuracy.
 * @throws NotStrictlyPositiveException if {@code sd <= 0}.
 * @since 2.1
 */
public NormalDistributionImpl(double mean, double sd, double inverseCumAccuracy) {
	if (sd <= 0) {
		throw new NotStrictlyPositiveException(LocalizedFormats.STANDARD_DEVIATION, sd);
	}

	this.mean = mean;
	standardDeviation = sd;
	solverAbsoluteAccuracy = inverseCumAccuracy;
}
 
Example 5
Source File: NormalDistributionImpl.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Create a normal distribution using the given mean, standard deviation and
 * inverse cumulative distribution accuracy.
 *
 * @param mean Mean for this distribution.
 * @param sd Standard deviation for this distribution.
 * @param inverseCumAccuracy Inverse cumulative probability accuracy.
 * @throws NotStrictlyPositiveException if {@code sd <= 0}.
 * @since 2.1
 */
public NormalDistributionImpl(double mean, double sd, double inverseCumAccuracy) {
    if (sd <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.STANDARD_DEVIATION, sd);
    }

    this.mean = mean;
    standardDeviation = sd;
    solverAbsoluteAccuracy = inverseCumAccuracy;
}
 
Example 6
Source File: RandomDataImpl.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Generate a random value from a Normal (a.k.a. Gaussian) distribution with
 * the given mean, <code>mu</code> and the given standard deviation,
 * <code>sigma</code>.
 *
 * @param mu
 *            the mean of the distribution
 * @param sigma
 *            the standard deviation of the distribution
 * @return the random Normal value
 * @throws NotStrictlyPositiveException if {@code sigma <= 0}.
 */
public double nextGaussian(double mu, double sigma) {
    if (sigma <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.STANDARD_DEVIATION, sigma);
    }
    return sigma * getRan().nextGaussian() + mu;
}
 
Example 7
Source File: RandomDataImpl.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Generate a random value from a Normal (a.k.a. Gaussian) distribution with
 * the given mean, <code>mu</code> and the given standard deviation,
 * <code>sigma</code>.
 *
 * @param mu
 *            the mean of the distribution
 * @param sigma
 *            the standard deviation of the distribution
 * @return the random Normal value
 * @throws NotStrictlyPositiveException if {@code sigma <= 0}.
 */
public double nextGaussian(double mu, double sigma) {
    if (sigma <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.STANDARD_DEVIATION, sigma);
    }
    return sigma * getRan().nextGaussian() + mu;
}
 
Example 8
Source File: NormalDistributionImpl.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Create a normal distribution using the given mean, standard deviation and
 * inverse cumulative distribution accuracy.
 *
 * @param mean Mean for this distribution.
 * @param sd Standard deviation for this distribution.
 * @param inverseCumAccuracy Inverse cumulative probability accuracy.
 * @throws NotStrictlyPositiveException if {@code sd <= 0}.
 * @since 2.1
 */
public NormalDistributionImpl(double mean, double sd, double inverseCumAccuracy) {
    if (sd <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.STANDARD_DEVIATION, sd);
    }

    this.mean = mean;
    standardDeviation = sd;
    solverAbsoluteAccuracy = inverseCumAccuracy;
}
 
Example 9
Source File: RandomDataImpl.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Generate a random value from a Normal (a.k.a. Gaussian) distribution with
 * the given mean, <code>mu</code> and the given standard deviation,
 * <code>sigma</code>.
 *
 * @param mu
 *            the mean of the distribution
 * @param sigma
 *            the standard deviation of the distribution
 * @return the random Normal value
 * @throws NotStrictlyPositiveException if {@code sigma <= 0}.
 */
public double nextGaussian(double mu, double sigma) {
    if (sigma <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.STANDARD_DEVIATION, sigma);
    }
    return sigma * getRan().nextGaussian() + mu;
}
 
Example 10
Source File: NormalDistributionImpl.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Create a normal distribution using the given mean, standard deviation and
 * inverse cumulative distribution accuracy.
 *
 * @param mean Mean for this distribution.
 * @param sd Standard deviation for this distribution.
 * @param inverseCumAccuracy Inverse cumulative probability accuracy.
 * @throws NotStrictlyPositiveException if {@code sd <= 0}.
 * @since 2.1
 */
public NormalDistributionImpl(double mean, double sd, double inverseCumAccuracy) {
    if (sd <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.STANDARD_DEVIATION, sd);
    }

    this.mean = mean;
    standardDeviation = sd;
    solverAbsoluteAccuracy = inverseCumAccuracy;
}
 
Example 11
Source File: RandomDataImpl.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Generate a random value from a Normal (a.k.a. Gaussian) distribution with
 * the given mean, <code>mu</code> and the given standard deviation,
 * <code>sigma</code>.
 *
 * @param mu
 *            the mean of the distribution
 * @param sigma
 *            the standard deviation of the distribution
 * @return the random Normal value
 * @throws NotStrictlyPositiveException if {@code sigma <= 0}.
 */
public double nextGaussian(double mu, double sigma) {
    if (sigma <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.STANDARD_DEVIATION, sigma);
    }
    return sigma * getRan().nextGaussian() + mu;
}