Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 78016 invoked from network); 8 Jun 2008 14:19:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Jun 2008 14:19:35 -0000 Received: (qmail 7095 invoked by uid 500); 8 Jun 2008 14:19:35 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 7035 invoked by uid 500); 8 Jun 2008 14:19:35 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 7024 invoked by uid 99); 8 Jun 2008 14:19:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Jun 2008 07:19:35 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.132.246] (HELO an-out-0708.google.com) (209.85.132.246) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Jun 2008 14:18:44 +0000 Received: by an-out-0708.google.com with SMTP id d18so399043and.72 for ; Sun, 08 Jun 2008 07:19:00 -0700 (PDT) Received: by 10.100.46.10 with SMTP id t10mr2368363ant.22.1212934734983; Sun, 08 Jun 2008 07:18:54 -0700 (PDT) Received: from ?192.168.1.184? ( [70.91.8.169]) by mx.google.com with ESMTPS id 33sm7807140yxr.3.2008.06.08.07.18.47 (version=SSLv3 cipher=RC4-MD5); Sun, 08 Jun 2008 07:18:48 -0700 (PDT) Message-ID: <484BEA45.2010801@gmail.com> Date: Sun, 08 Jun 2008 10:18:45 -0400 User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Commons Users List Subject: Re: commons.apache.org/math/stat/ References: <9ef66fac0806080434jf981e69ja368f43923539639@mail.gmail.com> <484BD6E7.9050400@gmail.com> <9ef66fac0806080639y28aeb316h22864e891a13fa87@mail.gmail.com> In-Reply-To: <9ef66fac0806080639y28aeb316h22864e891a13fa87@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit From: Phil Steitz X-Virus-Checked: Checked by ClamAV on apache.org Albretch Mueller wrote: >> Anyone else have ideas on how best to do this? >> > ~ > IMHO this is so simple that I would doubt there is a "best" way to do it ;-). > What I meant was the best way to define the API. There are also numerical considerations. In the commons math descriptive statistics package, we have two kinds of univariate statistics - those that "store" associated data values, and those that do not. The DescriptiveStatistics class aggregates statistics based on a "stored" dataset (so should not be used for very large datasets, unless "rolling" statistics are desired). The class to look at to design updating functions like you are suggesting is SummaryStatistics, which does not store data values, but updates internal sums, etc. The updating formulas for moment statistics (mean, variance, skewness) are not naive, so the util functions that you are proposing would have to be coded with care so that results would match; or at least be documented appropriately. > you are the ones that know well/own the underlying data structures and logic > ~ > If you take a close look at: > ~ > http://en.wikipedia.org/wiki/Mean > http://en.wikipedia.org/wiki/Standard_deviation > http://en.wikipedia.org/wiki/Skewness > ~ > You will see that, since these are essentially summations and their > exponentiations, you could derive the relationship of the new stat > values based on: > ~ > 1) the old stat ones, > 2) the count of how many have been computed so far, and > 3) the new entry > ~ > I must run out of my place right now. If no one has done so when I > come back (within 2 hours) I will digest to > you/user@commons.apache.org the math, propose some pseudo code along > with some basic java code on how to do that. > Thanks! Its probably best to take the discussion to the dev list. Phil --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org