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

The following examples show how to use org.apache.commons.math3.exception.util.LocalizedFormats#NOT_POSITIVE_SCALE . 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: LogisticDistribution.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Build a new instance.
 *
 * @param rng Random number generator
 * @param mu location parameter
 * @param s scale parameter (must be positive)
 * @throws NotStrictlyPositiveException if {@code beta <= 0}
 */
public LogisticDistribution(RandomGenerator rng, double mu, double s) {
    super(rng);

    if (s <= 0.0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.NOT_POSITIVE_SCALE, s);
    }

    this.mu = mu;
    this.s = s;
}
 
Example 2
Source File: LaplaceDistribution.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Build a new instance.
 *
 * @param rng Random number generator
 * @param mu location parameter
 * @param beta scale parameter (must be positive)
 * @throws NotStrictlyPositiveException if {@code beta <= 0}
 */
public LaplaceDistribution(RandomGenerator rng, double mu, double beta) {
    super(rng);

    if (beta <= 0.0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.NOT_POSITIVE_SCALE, beta);
    }

    this.mu = mu;
    this.beta = beta;
}
 
Example 3
Source File: NakagamiDistribution.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Build a new instance.
 *
 * @param rng Random number generator
 * @param mu shape parameter
 * @param omega scale parameter (must be positive)
 * @param inverseAbsoluteAccuracy the maximum absolute error in inverse
 * cumulative probability estimates (defaults to {@link #DEFAULT_INVERSE_ABSOLUTE_ACCURACY}).
 * @throws NumberIsTooSmallException if {@code mu < 0.5}
 * @throws NotStrictlyPositiveException if {@code omega <= 0}
 */
public NakagamiDistribution(RandomGenerator rng, double mu, double omega, double inverseAbsoluteAccuracy) {
    super(rng);

    if (mu < 0.5) {
        throw new NumberIsTooSmallException(mu, 0.5, true);
    }
    if (omega <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.NOT_POSITIVE_SCALE, omega);
    }

    this.mu = mu;
    this.omega = omega;
    this.inverseAbsoluteAccuracy = inverseAbsoluteAccuracy;
}
 
Example 4
Source File: LogisticDistribution.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Build a new instance.
 *
 * @param rng Random number generator
 * @param mu location parameter
 * @param s scale parameter (must be positive)
 * @throws NotStrictlyPositiveException if {@code beta <= 0}
 */
public LogisticDistribution(RandomGenerator rng, double mu, double s) {
    super(rng);

    if (s <= 0.0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.NOT_POSITIVE_SCALE, s);
    }

    this.mu = mu;
    this.s = s;
}
 
Example 5
Source File: LaplaceDistribution.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Build a new instance.
 *
 * @param rng Random number generator
 * @param mu location parameter
 * @param beta scale parameter (must be positive)
 * @throws NotStrictlyPositiveException if {@code beta <= 0}
 */
public LaplaceDistribution(RandomGenerator rng, double mu, double beta) {
    super(rng);

    if (beta <= 0.0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.NOT_POSITIVE_SCALE, beta);
    }

    this.mu = mu;
    this.beta = beta;
}
 
Example 6
Source File: NakagamiDistribution.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Build a new instance.
 *
 * @param rng Random number generator
 * @param mu shape parameter
 * @param omega scale parameter (must be positive)
 * @param inverseAbsoluteAccuracy the maximum absolute error in inverse
 * cumulative probability estimates (defaults to {@link #DEFAULT_INVERSE_ABSOLUTE_ACCURACY}).
 * @throws NumberIsTooSmallException if {@code mu < 0.5}
 * @throws NotStrictlyPositiveException if {@code omega <= 0}
 */
public NakagamiDistribution(RandomGenerator rng, double mu, double omega, double inverseAbsoluteAccuracy) {
    super(rng);

    if (mu < 0.5) {
        throw new NumberIsTooSmallException(mu, 0.5, true);
    }
    if (omega <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.NOT_POSITIVE_SCALE, omega);
    }

    this.mu = mu;
    this.omega = omega;
    this.inverseAbsoluteAccuracy = inverseAbsoluteAccuracy;
}