i = 1; for (;;) { // while (!NULL) { if ((factorial(i) * Math.pow((8.0 * beta), i)) > 1.0e250) break; if (i > 10) sum = sum + prod / (factorial(i) * Math.pow((8.0 * beta), i)); i++; erg = -Math.log(gamma(lambda)) - lambda * Math.log(2.0) + lambda * Math.log(beta); return (erg); } else { fx = (fkt2_value(lambda, beta, x)) * 0.01; y = 0.0; for (;;) { // while (!NULL) { y += 0.1; if ((fkt2_value(lambda, beta, y)) < fx) break; sum = (0.5 * (10.0 * step + fkt2_value(lambda, beta, x1))) * step; first_value = sum; for (;;) { // while (!NULL) { x = x1; x1 += step; new_value = (0.5 * (fkt2_value(lambda, beta, x) + fkt2_value(lambda, beta, x1))) * step; sum += new_value; if ((new_value / first_value) < epsilon)
i = 1; for (;;) { // while (!NULL) { if ((factorial(i) * Math.pow((8.0 * beta), i)) > 1.0e250) break; if (i > 10) sum = sum + prod / (factorial(i) * Math.pow((8.0 * beta), i)); i++; erg = -Math.log(gamma(lambda)) - lambda * Math.log(2.0) + lambda * Math.log(beta); return (erg); } else { fx = (fkt2_value(lambda, beta, x)) * 0.01; y = 0.0; for (;;) { // while (!NULL) { y += 0.1; if ((fkt2_value(lambda, beta, y)) < fx) break; sum = (0.5 * (10.0 * step + fkt2_value(lambda, beta, x1))) * step; first_value = sum; for (;;) { // while (!NULL) { x = x1; x1 += step; new_value = (0.5 * (fkt2_value(lambda, beta, x) + fkt2_value(lambda, beta, x1))) * step; sum += new_value; if ((new_value / first_value) < epsilon)
/** * Returns the gamma function <tt>gamma(x)</tt>. */ public static double gamma(double x) { x = logGamma(x); // if (x > Math.log(Double.MAX_VALUE)) return Double.MAX_VALUE; return Math.exp(x); }
/** * Returns the gamma function <tt>gamma(x)</tt>. */ public static double gamma(double x) { x = logGamma(x); // if (x > Math.log(Double.MAX_VALUE)) return Double.MAX_VALUE; return Math.exp(x); }
/** * Sets the distribution parameter. * * @param freedom * degrees of freedom. * @throws IllegalArgumentException * if <tt>freedom <= 0.0</tt>. */ public void setState(double freedom) { if (freedom <= 0.0) throw new IllegalArgumentException(); this.freedom = freedom; double val = Fun.logGamma((freedom + 1) / 2) - Fun.logGamma(freedom / 2); this.TERM = Math.exp(val) / Math.sqrt(Math.PI * freedom); }
/** * Returns the probability distribution function. */ public double pdf(double x) { if (x <= 0.0) throw new IllegalArgumentException(); double logGamma = Fun.logGamma(freedom / 2.0); return Math.exp((freedom / 2.0 - 1.0) * Math.log(x / 2.0) - x / 2.0 - logGamma) / 2.0; }
/** * Sets the distribution parameter. * * @param freedom * degrees of freedom. * @throws IllegalArgumentException * if <tt>freedom <= 0.0</tt>. */ public void setState(double freedom) { if (freedom <= 0.0) throw new IllegalArgumentException(); this.freedom = freedom; double val = Fun.logGamma((freedom + 1) / 2) - Fun.logGamma(freedom / 2); this.TERM = Math.exp(val) / Math.sqrt(Math.PI * freedom); }
/** * Returns the probability distribution function. */ public double pdf(double x) { if (x <= 0.0) throw new IllegalArgumentException(); double logGamma = Fun.logGamma(freedom / 2.0); return Math.exp((freedom / 2.0 - 1.0) * Math.log(x / 2.0) - x / 2.0 - logGamma) / 2.0; }
/** * Returns the probability distribution function. */ public double pdf(double x) { if (x < 0) throw new IllegalArgumentException(); 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 - Fun.logGamma(alpha)) / lambda; }
/** * Returns the probability distribution function. */ public double pdf(double x) { if (x < 0) throw new IllegalArgumentException(); 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 - Fun.logGamma(alpha)) / lambda; }