## unbiased iterative function

For the discussion of math. Duh.

Moderators: gmalivuk, Moderators General, Prelates

4=5
Posts: 2073
Joined: Sat Apr 28, 2007 3:02 am UTC

### unbiased iterative function

I have a list of 50 random numbers generated from an even distribution.
I want to generate another from the same distribution, replace the oldest number with it, and then repeat.

How do I keep the range of values from converging to 0?

My current method is to find the average distance from the average value and pick a random number from double that range but that ends up at zero.

gmalivuk
GNU Terry Pratchett
Posts: 26836
Joined: Wed Feb 28, 2007 6:02 pm UTC
Location: Here and There
Contact:

### Re: unbiased iterative function

Well experimentally it appears that the expected mean absolute deviation for 50 data points is near 0.24663 times the range of the uniform distribution, whereas you want it at exactly 1/4 to maintain the same distribution for your next point.

So I guess one option is to calculate this value exactly, and then scale appropriately.

Alternatively, you could use sample variance instead, which is unbiased.
Unless stated otherwise, I do not care whether a statement, by itself, constitutes a persuasive political argument. I care whether it's true.
---
If this post has math that doesn't work for you, use TeX the World for Firefox or Chrome

(he/him/his)