Package jmt.common.exception

Examples of jmt.common.exception.IncorrectDistributionParameterException


   * @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");
    }
    // Keeps variation coefficient c constant
    double c = (max - min) / (max + min) * Math.sqrt(3);
    max = meanValue + meanValue * c / Math.sqrt(3);
    min = meanValue - meanValue * c / Math.sqrt(3);
View Full Code Here


    if (p.check()) {
      //OLD
      //double mean = p.getMean();
      double mean = ((PoissonPar) p).getMean();
      if (Math.floor(x) != x) {
        throw new IncorrectDistributionParameterException("Error: x must be integer.");
      }
      return Math.exp(x * Math.log(mean) - Arithmetic.logFactorial((int) x) - mean);
    } else {
      throw new IncorrectDistributionParameterException("Remember: parameter mean must be gtz");
    }
  }
View Full Code Here

      //OLD
      //double mean = p.getMean();
      double mean = ((PoissonPar) p).getMean();
      return Probability.poisson((int) x, mean);
    } else {
      throw new IncorrectDistributionParameterException("Remember: parameter mean must be gtz");
    }
  }
View Full Code Here

    if (p.check()) {
      //OLD
      //return p.getMean();
      return ((PoissonPar) p).getMean();
    } else {
      throw new IncorrectDistributionParameterException("Remember: parameter mean must be gtz");
    }
  }
View Full Code Here

    if (p.check()) {
      //OLD
      //return p.getMean();
      return ((PoissonPar) p).getMean();
    } else {
      throw new IncorrectDistributionParameterException("Remember: parameter mean must be gtz");
    }
  }
View Full Code Here

        }
      } else { // mean is too large
        return (int) my;
      }
    } else {
      throw new IncorrectDistributionParameterException("Remember: parameter mean must be gtz");
    }
  }
View Full Code Here

        return 0.0;
      } else {
        return 1.0;
      }
    } else {
      throw new IncorrectDistributionParameterException("parameter t must be >0");
    }
  }
View Full Code Here

        return 0.0;
      } else {
        return 1.0;
      }
    } else {
      throw new IncorrectDistributionParameterException("parameter t must be >0");
    }
  }
View Full Code Here

    if (p.check()) {
      //OLD
      //return p.getT();
      return ((DeterministicDistrPar) p).getParameterValue();
    } else {
      throw new IncorrectDistributionParameterException("parameter t must be >0");
    }
  }
View Full Code Here

  //public double theorVariance(ConstantDistrPar p)
  public double theorVariance(Parameter p) throws IncorrectDistributionParameterException {
    if (p.check()) {
      return 0;
    } else {
      throw new IncorrectDistributionParameterException("parameter t 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.