Package jmt.common.exception

Examples of jmt.common.exception.IncorrectDistributionParameterException


    if (p.check()) {
      double alpha = ((ParetoPar) p).getAlpha();
      double k = ((ParetoPar) p).getK();
      return Math.pow((1 - engine.raw()), (-1 / alpha)) * k;
    } else {
      throw new IncorrectDistributionParameterException("Remember: parameter alpha and k must be gtz");
    }
  }
View Full Code Here


   * @throws IncorrectDistributionParameterException if the value provided for the standard deviation is not greater than zero.
   *
   */
  public NormalPar(double mean, double standardDeviation) throws IncorrectDistributionParameterException {
    if (standardDeviation <= 0) {
      throw new IncorrectDistributionParameterException("standardDeviation must be > 0");
    } else {
      this.standardDeviation = standardDeviation;
      this.mean = mean;
    }
  }
View Full Code Here

   *
   */

  public void setStandardDeviation(double standardDeviation) throws IncorrectDistributionParameterException {
    if (standardDeviation <= 0) {
      throw new IncorrectDistributionParameterException("standardDeviation must be gtz");
    } else {
      this.standardDeviation = standardDeviation;
    }
  }
View Full Code Here

      double freedom = ((StudentTPar) p).getFreedom();
      double val = Sfun.logGamma((freedom + 1) / 2) - Sfun.logGamma(freedom / 2);
      double TERM = Math.exp(val) / Math.sqrt(Math.PI * freedom);
      return TERM * Math.pow((1 + x * x / freedom), -(freedom + 1) * 0.5);
    } else {
      throw new IncorrectDistributionParameterException("Remember: the number of degrees of freedom must be an integer gtz");
    }
  }
View Full Code Here

      //OLD
      //double freedom = p.getFreedom();
      double freedom = ((StudentTPar) p).getFreedom();
      return Probability.studentT(freedom, x);
    } else {
      throw new IncorrectDistributionParameterException("Remember: the number of degrees of freedom must be an integer gtz");
    }
  }
View Full Code Here

  public double theorMean(Parameter p) throws IncorrectDistributionParameterException {
    //alternative implementation may use p.check()
    if (p.check()) {
      return 0;
    } else {
      throw new IncorrectDistributionParameterException("");
    }
  }
View Full Code Here

        return 0;
      } else {
        return freedom / (freedom - 2);
      }
    } else {
      throw new IncorrectDistributionParameterException("Remember: the number of degrees of freedom must be an integer gtz");
    }
  }
View Full Code Here

      } while ((w = u * u + v * v) > 1.0);
      // If generated number is in the past, reruns this method
      double ret = (u * Math.sqrt(freedom * (Math.exp(-2.0 / freedom * Math.log(w)) - 1.0) / w));
      return (ret > 0) ? ret : nextRand(p);
    } else {
      throw new IncorrectDistributionParameterException("Remember: the number of degrees of freedom must be an integer gtz");
    }
  }
View Full Code Here

  public double theorMean(Parameter p) throws IncorrectDistributionParameterException {
    if (p.check()) {
      return ((HyperExpPar) p).getMean();
    } else {
      throw new IncorrectDistributionParameterException(
          "Remember: parameter mean, variance, lambda1 and lambda 2 must be gtz; p must be a number betwen 0 and 1");
    }
  }
View Full Code Here

   */
  public double theorVariance(Parameter p) throws IncorrectDistributionParameterException {
    if (p.check()) {
      return ((HyperExpPar) p).getVar();
    } else {
      throw new IncorrectDistributionParameterException(
          "Remember: parameter mean, variance, lambda1 and lambda 2 must be gtz; p must be a number betwen 0 and 1");
    }
  }
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.