Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4801A943E for ; Sun, 23 Oct 2011 21:02:53 +0000 (UTC) Received: (qmail 22762 invoked by uid 500); 23 Oct 2011 21:02:52 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 22675 invoked by uid 500); 23 Oct 2011 21:02:52 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 22667 invoked by uid 99); 23 Oct 2011 21:02:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Oct 2011 21:02:52 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Oct 2011 21:02:51 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 64740318980 for ; Sun, 23 Oct 2011 21:00:32 +0000 (UTC) Date: Sun, 23 Oct 2011 21:00:32 +0000 (UTC) From: "Phil Steitz (Commented) (JIRA)" To: issues@commons.apache.org Message-ID: <1470959314.7089.1319403632412.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1175555992.7216.1318960990578.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (MATH-692) Cumulative probability and inverse cumulative probability inconsistencies MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MATH-692?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13133745#comment-13133745 ] Phil Steitz commented on MATH-692: ---------------------------------- I guess I am OK with pushing p(x) up. See related post to follow in commons-dev. > Cumulative probability and inverse cumulative probability inconsistencies > ------------------------------------------------------------------------- > > Key: MATH-692 > URL: https://issues.apache.org/jira/browse/MATH-692 > Project: Commons Math > Issue Type: Bug > Affects Versions: 1.0, 1.1, 1.2, 1.3, 2.0, 2.1, 2.2, 2.2.1, 3.0 > Reporter: Christian Winter > Priority: Minor > Fix For: 3.0 > > > There are some inconsistencies in the documentation and implementation of functions regarding cumulative probabilities and inverse cumulative probabilities. More precisely, '<' and '<=' are not used in a consistent way. > Besides I would move the function inverseCumulativeProbability(double) to the interface Distribution. A true inverse of the distribution function does neither exist for Distribution nor for ContinuosDistribution. Thus we need to define the inverse in terms of quantiles anyway, and this can already be done for Distribution. > On the whole I would declare the (inverse) cumulative probability functions in the basic distribution interfaces as follows: > Distribution: > - cumulativeProbability(double x): returns P(X <= x) > - cumulativeProbability(double x0, double x1): returns P(x0 < X <= x1) [see also 1)] > - inverseCumulativeProbability(double p): > returns the quantile function inf{x in R | P(X<=x) >= p} [see also 2), 3), and 4)] > 1) An aternative definition could be P(x0 <= X <= x1). But this requires to put the function probability(double x) or another cumulative probability function into the interface Distribution in order be able to calculate P(x0 <= X <= x1) in AbstractDistribution. > 2) This definition is stricter than the definition in ContinuousDistribution, because the definition there does not specify what to do if there are multiple x satisfying P(X<=x) = p. > 3) A modification could be defined for p=0: Returning sup{x in R | P(X<=x) = 0} would yield the infimum of the distribution's support instead of a mandatory -infinity. > 4) This affects issue MATH-540. I'd prefere the definition from above for the following reasons: > - This definition simplifies inverse transform sampling (as mentioned in the other issue). > - It is the standard textbook definition for the quantile function. > - For integer distributions it has the advantage that the result doesn't change when switching to "x in Z", i.e. the result is independent of considering the intergers as sole set or as part of the reals. > ContinuousDistribution: > nothing to be added regarding (inverse) cumulative probability functions > IntegerDistribution: > - cumulativeProbability(int x): returns P(X <= x) > - cumulativeProbability(int x0, int x1): returns P(x0 < X <= x1) [see also 1) above] -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira