Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 61432 invoked from network); 2 Dec 2007 19:49:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Dec 2007 19:49:07 -0000 Received: (qmail 84378 invoked by uid 500); 2 Dec 2007 19:48:54 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 84292 invoked by uid 500); 2 Dec 2007 19:48:54 -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 84283 invoked by uid 99); 2 Dec 2007 19:48:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Dec 2007 11:48:54 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Dec 2007 19:49:04 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 03D727141EB for ; Sun, 2 Dec 2007 11:48:43 -0800 (PST) Message-ID: <16629955.1196624922996.JavaMail.jira@brutus> Date: Sun, 2 Dec 2007 11:48:42 -0800 (PST) From: "Luc Maisonobe (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (MATH-174) Mean.evaluate() should use a two-pass algorithm In-Reply-To: <29986452.1196622942996.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MATH-174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12547660 ] Luc Maisonobe commented on MATH-174: ------------------------------------ I agree with you, go ahead with this change. > Mean.evaluate() should use a two-pass algorithm > ----------------------------------------------- > > Key: MATH-174 > URL: https://issues.apache.org/jira/browse/MATH-174 > Project: Commons Math > Issue Type: Bug > Affects Versions: 1.0, 1.1 > Reporter: Phil Steitz > Priority: Minor > Fix For: 1.2 > > Attachments: mean.patch > > > Since it has access to the full array of stored data, Mean.evaluate(double[]) can improve its accuracy by executing a two-pass algorithm, first computing an initial estimate using the definitional forumla and then correcting that value by the mean deviation against that value. The attached patch makes the correction and includes an algorithm reference. It also re-activates and increases sensitivity in some of the certified data tests. The Michelson data test fails with the current implementation, showing a difference in the 13th significant digit. > This change will improve accuracy in DescriptiveStatistics.getMean and also in Variance.evaluate() and DescriptiveStatistics.getVariance(). There is a cost associated with the change - as it roughly doubles the arithmetic operations required to compute the mean. Since it only applies to the "stored array" implementation and the implementation will be pluggable in 1.2, my preference is to move ahead with this change. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.