Package jmt.common.exception

Examples of jmt.common.exception.IncorrectDistributionParameterException


   */
  public void setParameterValue(double t) throws IncorrectDistributionParameterException {
    if (!(t < 0)) {
      this.t = t;
    } else {
      throw new IncorrectDistributionParameterException("t < 0");
    }
  }
View Full Code Here


   * @throws IncorrectDistributionParameterException if mean value is invalid for this distribution
   */
  @Override
  public void setMean(double meanValue) throws IncorrectDistributionParameterException {
    if (meanValue < 0 || Double.isInfinite(meanValue)) {
      throw new IncorrectDistributionParameterException("Mean value must be finite and greater than zero");
    }
    t = meanValue;
  }
View Full Code Here

   * @throws IncorrectDistributionParameterException if alpha or lambda are not greater than zero.
   *
   */
  public GammaDistrPar(double alpha, double lambda) throws IncorrectDistributionParameterException {
    if ((alpha <= 0.0) || (lambda <= 0.0)) {
      throw new IncorrectDistributionParameterException("alpha and lambda must be >0.");
    } else {
      this.alpha = alpha;
      this.lambda = lambda;
    }
  }
View Full Code Here

   *
   */

  public void setAlpha(double alpha) throws IncorrectDistributionParameterException {
    if (alpha <= 0.0) {
      throw new IncorrectDistributionParameterException("alpha must be >0.");
    } else {
      this.alpha = alpha;
    }
  }
View Full Code Here

   *
   */

  public void setLambda(double lambda) throws IncorrectDistributionParameterException {
    if (lambda <= 0.0) {
      throw new IncorrectDistributionParameterException("lambda must be >0.");
    } else {
      this.lambda = lambda;
    }
  }
View Full Code Here

   * @throws IncorrectDistributionParameterException if mean value is invalid for this distribution
   */
  @Override
  public void setMean(double meanValue) throws IncorrectDistributionParameterException {
    if (meanValue <= 0 || Double.isInfinite(meanValue)) {
      throw new IncorrectDistributionParameterException("Mean value must be finite and greater than zero");
    }
    lambda = meanValue / alpha;
  }
View Full Code Here

   * not an integer greater than zero.
   *
   */
  public StudentTPar(double freedom) throws IncorrectDistributionParameterException {
    if (freedom <= 0 || Math.floor(freedom) != freedom) {
      throw new IncorrectDistributionParameterException("The number of degrees of freedom must be an integer gtz");
    } else {
      this.freedom = freedom;
    }
  }
View Full Code Here

   */

  public void setFreedom(double freedom) throws IncorrectDistributionParameterException {
    this.freedom = freedom;
    if (!check()) {
      throw new IncorrectDistributionParameterException("The number of degrees of freedom must be an integer >0");
    }
  }
View Full Code Here

   *
   * @throws IncorrectDistributionParameterException if mean or variance are not both greater than zero.
   */
  private void testParameters() throws IncorrectDistributionParameterException {
    if (mean <= 0) {
      throw new IncorrectDistributionParameterException("Error: mean must be > 0");
    }
    if (var <= 0) {
      throw new IncorrectDistributionParameterException("Error: variance must be > 0");
    }
  }
View Full Code Here

   * @throws IncorrectDistributionParameterException if p is not betwen zero and one or if lambda1 and labda2 are not both greater than zero.
   *
   */
  private void testParameters1() throws IncorrectDistributionParameterException {
    if (p <= 0 || p >= 1) {
      throw new IncorrectDistributionParameterException("Error: must be 0 < p < 1");
    }
    if (lambda1 <= 0) {
      throw new IncorrectDistributionParameterException("Error: lambda1 must be >= 0");
    }
    if (lambda2 <= 0) {
      throw new IncorrectDistributionParameterException("Error: lambda2 must be >= 0");
    }
  }
View Full Code Here

TOP

Related Classes of jmt.common.exception.IncorrectDistributionParameterException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.