Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E92BEC0BA for ; Thu, 24 May 2012 19:23:59 +0000 (UTC) Received: (qmail 18045 invoked by uid 500); 24 May 2012 19:23:59 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 17980 invoked by uid 500); 24 May 2012 19:23:59 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 17972 invoked by uid 99); 24 May 2012 19:23:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 May 2012 19:23:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 May 2012 19:23:58 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 176852388980 for ; Thu, 24 May 2012 19:23:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1342404 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/GammaDistribution.java Date: Thu, 24 May 2012 19:23:38 -0000 To: commits@commons.apache.org From: celestin@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120524192338.176852388980@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: celestin Date: Thu May 24 19:23:37 2012 New Revision: 1342404 URL: http://svn.apache.org/viewvc?rev=1342404&view=rev Log: In o.a.c.m3.distribution.GammaDistribution - deprecated getAlpha() and created getShape() - deprecated getBeta() and created getScale(). See MATH-791. Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/GammaDistribution.java Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/GammaDistribution.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/GammaDistribution.java?rev=1342404&r1=1342403&r2=1342404&view=diff ============================================================================== --- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/GammaDistribution.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/GammaDistribution.java Thu May 24 19:23:37 2012 @@ -36,7 +36,7 @@ public class GammaDistribution extends A public static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY = 1e-9; /** Serializable version identifier. */ - private static final long serialVersionUID = 20120522L; + private static final long serialVersionUID = 20120524L; /** The shape parameter. */ private final double shape; @@ -104,7 +104,7 @@ public class GammaDistribution extends A * * @param shape the shape parameter * @param scale the scale parameter - * @param inverseCumAccuracy the aximum absolute error in inverse + * @param inverseCumAccuracy the maximum absolute error in inverse * cumulative probability estimates (defaults to * {@link #DEFAULT_INVERSE_ABSOLUTE_ACCURACY}). * @throws NotStrictlyPositiveException if {@code shape <= 0} or @@ -114,10 +114,10 @@ public class GammaDistribution extends A public GammaDistribution(double shape, double scale, double inverseCumAccuracy) throws NotStrictlyPositiveException { if (shape <= 0) { - throw new NotStrictlyPositiveException(LocalizedFormats.ALPHA, shape); + throw new NotStrictlyPositiveException(LocalizedFormats.SHAPE, shape); } if (scale <= 0) { - throw new NotStrictlyPositiveException(LocalizedFormats.BETA, scale); + throw new NotStrictlyPositiveException(LocalizedFormats.SCALE, scale); } this.shape = shape; @@ -137,21 +137,43 @@ public class GammaDistribution extends A * Returns the shape parameter of {@code this} distribution. * * @return the shape parameter + * @deprecated as of version 3.1, {@link #getShape()} should be preferred. + * This method will be removed in version 4.0. */ public double getAlpha() { return shape; } /** + * Returns the shape parameter of {@code this} distribution. + * + * @return the shape parameter + */ + public double getShape() { + return shape; + } + + /** * Returns the scale parameter of {@code this} distribution. * * @return the scale parameter + * @deprecated as of version 3.1, {@link #getScale()} should be preferred. + * This method will be removed in version 4.0. */ public double getBeta() { return scale; } /** + * Returns the scale parameter of {@code this} distribution. + * + * @return the scale parameter + */ + public double getScale() { + return scale; + } + + /** * {@inheritDoc} * * For this distribution {@code P(X = x)} always evaluates to 0. @@ -262,7 +284,7 @@ public class GammaDistribution extends A * mean is {@code alpha * beta}. */ public double getNumericalMean() { - return getAlpha() * getBeta(); + return shape * scale; } /** @@ -274,8 +296,7 @@ public class GammaDistribution extends A * @return {@inheritDoc} */ public double getNumericalVariance() { - final double b = getBeta(); - return getAlpha() * b * b; + return shape * scale * scale; } /**