Newsgroups: bit.listserv.stat-l
Date:         Thu, 16 Apr 1992 13:06:18 -0400
From:         Subodh Kumar <kumar@CS.UNC.EDU>
Subject:      Non-Static Statistics: A compilation of Responses
X-To:         stat-l%mcgill1.bitnet@mcnc.org

Thankyou every one who found the time to respond !!

********************************************************************************
			T H E    P R O B L E M
********************************************************************************
>> I have this problem of computing the estimate of average and variance of a
>> stochastic phenomenon with very little information.
>>
>> A stream of Sample data arrives at the monitoring station. The problem is
 that
>> the storage of all the old data is not allowed. All you have is the current
>> estimate of variance and average and the current sample (when you get a
 sample
>> data) to compute the new average and variance.
>>
>> * Is there some way to maintain reasonable estimates ?
>>
>> * Is there a way to give more weightage to the new data than the (very)
>>   old data ?
>>
>> * What if last few [about 5-10], but a constant number of, samples are
 allowed
>>   to be stored ?
>>
>> * What if the nature of the probability distribution function is known ?
>>
>> Subodh Kumar
>> kumar@cs.unc.edu
>> Dept. of Computer Science
>> UNC-Chapel Hill
>
>  Thanks for all the responses -
>
>  Do you think THIS is tooootally unreasonable -
>
>	NewAverage = OldAverage + ((NewValue-OldAverage)/OldVariance)
>	NewVariance = OldVariance + ((Squared(NewValue-NewAverage))/OldVariance)
>
>
>  Subodh
**************************************************************************
			R E S P O N S E S
**************************************************************************
From: BILL SIMPSON <WSIMPSON@UWPG02.UWINNIPEG.CA>

I am not an expert on this.
You can use the update method to calculate mean and variance
(cf DCooke, AH Craven, GM Clarke 1982 Basic statistical computing. Arnold)
x is your observation on current trial

mean=0
t=0
i=1
do
 read x value
 d=x-mean
 mean=((i-1)*mean+x)/i
 t=t+d*d*(i-1)/i
 sd=sqr(t/(i-1))    [obviously this won't work for i=1]
 i=i+1
loop

This will give you estimates of mean and sd based on all observations.
A simple way to ignore old observations is to reset m, t, and i once in a
while.

Bill Simpson
wsimpson@uwpg02.uwinnipeg.ca
**************************************************************************
From: "Paul A. Jargowsky" <jargo@vm.utdallas.edu>

No, you need to know the number of previous observations.
Then it is easy.
    Paul Jargowsky
    University of Texas at Dallas
**************************************************************************
From: "Peter A. Lachenbruch"               <IARSPAL@MVS.OAC.UCLA.EDU>
Subject: YOUR QUESTION ON EDSTAT
Status: R

Dr. Kumar - the problem you mention is one of updating a mean as we accumulate
data. This can be written as ((n-1)xb1+xn)/n =xb2, where xb2 is the mean after
n observations are gathered, and xb1 is the mean after n-1 observations are in.
Keith Muller of the Biostatistics department should be able to help you on
this - He's also working with Steve Pizer and Henry Fuchs. Please give him my
regards.
Tony Lachenbruch
**************************************************************************
From: <WARSHAW@BINAH.CC.BRANDEIS.EDU>

pleasse summarize the responses you received for the list.
**************************************************************************
From: "Paul A. Jargowsky" <jargo@vm.utdallas.edu>

Frankly, the two formulas you suggest make no sense at all.
At least none that I can see.
**************************************************************************
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU