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 BA5337C39 for ; Fri, 25 Nov 2011 06:55:09 +0000 (UTC) Received: (qmail 7639 invoked by uid 500); 25 Nov 2011 06:55:07 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 7271 invoked by uid 500); 25 Nov 2011 06:55:06 -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 7261 invoked by uid 99); 25 Nov 2011 06:55:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Nov 2011 06:55:02 +0000 X-ASF-Spam-Status: No, hits=-1999.9 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD,URI_HEX 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; Fri, 25 Nov 2011 06:55:00 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id A8C1B9EFD2 for ; Fri, 25 Nov 2011 06:54:40 +0000 (UTC) Date: Fri, 25 Nov 2011 06:54:40 +0000 (UTC) From: =?utf-8?Q?S=C3=A9bastien_Brisard_=28Commented=29_=28JIRA=29?= To: issues@commons.apache.org Message-ID: <2055717074.11044.1322204080706.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <859386096.11914.1320783471556.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (MATH-703) Splitting up the distribution hierarchy MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MATH-703?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D131570= 01#comment-13157001 ]=20 S=C3=A9bastien Brisard commented on MATH-703: ---------------------------------------- Hi Christian, I've reviewed your patch, and have some concerns * in class {{AbstractRealDistribution}}, the mean and variance of the actua= l distribution is cached, which is good, but I think that nothing guarantee= s immutability of classes inheriting {{AbstractRealDistribution}}. For exam= ple, I might implement my own normal distribution, with {{setMean(double)}}= and {{setVariance(double)}} methods, and I would then need to make sure th= e proper private fields in the {{AbstractRealDistribution}} are updated acc= ordingly. While caching should be allowed for in this hierarchy of classes,= I think no default implementation of {{getNumericalMean()}} and {{getNumer= icalVariance()}} should be provided at this stage. This might be silly, ple= ase correct me if I'm wrong. I think people raised the same concerns about = the dimensions of the domain and codomain of linear operators, when I first= submitted an implementation where these dimensions where stored in the bas= e abstract class. * I'm not convinced about {{AbstractDefaultRealDistribution}} and {{Abstrac= tDefaultIntegerDistribution}}: not having them would only mean that we woul= d need to implement one or two additional methods, with very simple (in fac= t, constant, as you noticed) values. So we need to compare this slight inco= nvenience on the one hand with the encumbrance of the class hierarchy on th= e other hand... And in any case, people would *always* have to refer to the= Javadoc of these default implementations to make sure that what they want = to implement is indeed a {{AbstractDefaultXxxDistribution}} These are only my views, though, and I'm going to post an invitation on the= mailing-list in order to invite others to review your work. =20 > Splitting up the distribution hierarchy > --------------------------------------- > > Key: MATH-703 > URL: https://issues.apache.org/jira/browse/MATH-703 > Project: Commons Math > Issue Type: Improvement > Reporter: Christian Winter > Priority: Minor > Attachments: MATH-703_patch.zip > > > As discussed on the mailing list (http://apache-commons.680414.n4.nabble.= com/math-Distributions-over-sample-spaces-other-than-R-tp3931349p3931349.ht= ml), the distribution interfaces should be restructured. > The most important point is to create one root interface for each domain.= There should *not* be a common super-interace because different domains re= quire different functionality. Additionally, a super-inferface would requir= e to parametrize the domain which makes things more complicated (e.g., "dou= ble" would have to be replaced by "Double"). Currently, Commons Math suppor= ts distributions with real domain and distributions with integer domain. Th= us there will be the interfaces RealDistribution and IntegerDistribution. > Another point is to drop the special cases of distributions with real dom= ain in order to simplify the structure. There won't be an interface for abs= olutely continuous distributions, and there won't be an interface for discr= ete distributions on the real domain. All the functionality required by the= special cases can be defined in RealDistribution. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira