Package jmt.common.exception

Examples of jmt.common.exception.IncorrectDistributionParameterException


      //double lambda = p.getLambda();
      //double alpha = p.getAlpha();
      double lambda = ((GammaDistrPar) p).getLambda();
      double alpha = ((GammaDistrPar) p).getAlpha();
      if (x < 0) {
        throw new IncorrectDistributionParameterException("x must be >= 0.0");
      }
      if (x == 0) {
        if (alpha == 1.0) {
          return 1.0 / lambda;
        } else {
          return 0.0;
        }
      }
      if (alpha == 1.0) {
        return Math.exp(-x / lambda) / lambda;
      }

      return Math.exp((alpha - 1.0) * Math.log(x / lambda) - x / lambda - Sfun.logGamma(alpha)) / lambda;
    } else {
      throw new IncorrectDistributionParameterException("Remember: parameter alpha and lambda must be gtz");
    }
  }
View Full Code Here


  private double evaluateFunction(Parser parser, int n) throws IncorrectDistributionParameterException {
    try {
      parser.setVariable(VARIABLE, n);
      return parser.getValue();
    } catch (RuntimeException e1) {
      throw new IncorrectDistributionParameterException("Error: invalid function to be parsed for load dependent service section --> "
          + e1.getMessage());
    }
  }
View Full Code Here

      //double alpha = p.getAlpha();
      double lambda = ((GammaDistrPar) p).getLambda();
      double alpha = ((GammaDistrPar) p).getAlpha();
      return Probability.gamma(alpha, lambda, x);
    } else {
      throw new IncorrectDistributionParameterException("Remember: parameter alpha and lambda must be gtz");
    }
  }
View Full Code Here

      //double alpha = p.getAlpha();
      double lambda = ((GammaDistrPar) p).getLambda();
      double alpha = ((GammaDistrPar) p).getAlpha();
      return alpha / lambda;
    } else {
      throw new IncorrectDistributionParameterException("Remember: parameter alpha and lambda must be gtz");
    }
  }
View Full Code Here

      //double alpha = p.getAlpha();
      double lambda = ((GammaDistrPar) p).getLambda();
      double alpha = ((GammaDistrPar) p).getAlpha();
      return alpha / (lambda * lambda);
    } else {
      throw new IncorrectDistributionParameterException("Remember: parameter alpha and lambda must be gtz");
    }
  }
View Full Code Here

            return (x * x / lambda);
          }
        }
      }
    } else {
      throw new IncorrectDistributionParameterException("Remember: parameter alpha and lambda must be gtz");
    }
  }
View Full Code Here

      double SQRT_INV = 1.0 / Math.sqrt(2.0 * Math.PI * variance);
      double mean = ((NormalPar) p).getMean();
      double diff = x - mean;
      return SQRT_INV * Math.exp(-(diff * diff) / (2.0 * variance));
    } else {
      throw new IncorrectDistributionParameterException("Remember: standardDeviation must be gtz");
    }
  }
View Full Code Here

      //double variance = p.getStandardDeviation() * p.getStandardDeviation();
      double mean = ((NormalPar) p).getMean();
      double variance = ((NormalPar) p).getStandardDeviation() * ((NormalPar) p).getStandardDeviation();
      return Probability.normal(mean, variance, x);
    } else {
      throw new IncorrectDistributionParameterException("Remember: standardDeviation must be gtz");
    }
  }
View Full Code Here

      //OLD
      //double mean = p.getMean();
      double mean = ((NormalPar) p).getMean();
      return mean;
    } else {
      throw new IncorrectDistributionParameterException("Remember: standardDeviation must be gtz");
    }
  }
View Full Code Here

      //OLD
      //double variance = (p.getStandardDeviation() * p.getStandardDeviation());
      double variance = ((NormalPar) p).getStandardDeviation() * ((NormalPar) p).getStandardDeviation();
      return variance;
    } else {
      throw new IncorrectDistributionParameterException("Remember: standardDeviation must be gtz");
    }
  }
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.