Пример #1
0
  @SuppressWarnings("deprecation")
  protected final void compute() {

    if (input[0].isDefined() && input[1].isDefined() && input[2].isDefined()) {
      int param = (int) Math.round(a.getDouble());
      double val = b.getDouble();
      try {
        PoissonDistribution dist = getPoissonDistribution(param);
        if (isCumulative.getBoolean()) num.setValue(dist.cumulativeProbability(val)); // P(X <= val)
        else num.setValue(dist.probability(val)); // P(X = val)
      } catch (Exception e) {
        Application.debug(e.getMessage());
        num.setUndefined();
      }
    } else num.setUndefined();
  }