[issue21046] Document formulas used in statistics

2014-03-24 Thread Alextp

Alextp added the comment:

I'm author or topic

I suggest to give simple formulas. for ex -

1) mean. 
Calculates sum of all values in iterable, divided by number of elements. 
E.g. 
mean([x1, x2, ..., xN]) = (x1 + x2 + ... + xN) / N

2) median. 
Calculates value with middle index from iterable. 
If number of elements is even, ie no strict middle index exists, then function 
takes average of two values at two indexes near middle.

E.g.
median([x1, x2, x3, x4, x5]) = x3
median([x1, x2, x3, x4, x5, x6]) = (x3 + x4) / 2

3) median_low.
 Calculates value with middle index from iterable. 
If number of elements is even, ie no strict middle index exists, then function 
takes value at near index, lower than middle.


4) median_high.
 Calculates value with middle index from iterable. 
If number of elements is even, ie no strict middle index exists, then function 
takes value at near index, higher than middle.

5) median_grouped.
(((NOTE!! I may not understand median_grouped OK)))
Calculates average of values of iterable at L given middle indexes.

E.g.
median_grouped([x1, x2, x3, x4, x5], L=3) = (x2+x3+x4)/3

NOTE: pls check this!

--
nosy: +Alextp

___
Python tracker 
<http://bugs.python.org/issue21046>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21046] Document formulas used in statistics

2014-03-24 Thread Alextp

Alextp added the comment:

I wrote not ok formula for median_grouped. But i can't get idea from source. 
THIS SHOWS that source code is NOT ok doc, even student can't get it
 
e.g. pvariance.
Calculates population variance of iterable. It's given by formula:

pvariance([x1, x2, ..., xN]) = ((x1 - M)**2 + ... + (xN - M)**2) / N,
where M is mean of all values:
M = (x1 + ... + xN) / N

--

___
Python tracker 
<http://bugs.python.org/issue21046>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21046] Document formulas used in statistics

2014-03-24 Thread Alextp

Alextp added the comment:

5) pvariance.
Calculates "population variance" of iterable by such formula:

pvariance([x1, x2, ..., xN], M) = ((x1 - M)**2 + ... + (xN - M)**2) / N

M is optional argument which should be value of mean([x1, ... xN]) calculated 
before. If M parameter is missed in call, it's calculated automatically:
M = (x1 + ... + xN) / N

6) variance.
(NOTE: pls check this.)
Calculates "sample variance" from iterable. It's given by the same formula as 
pvariance, but not for entire iterable value set. Only subset of iterable is 
used for calculation. .. (write here how this subset is taken, randomly 
or what. i didn't get it from Wikipedia.)

Ok?

--

___
Python tracker 
<http://bugs.python.org/issue21046>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21046] Document formulas used in statistics

2014-03-24 Thread Alextp

Alextp added the comment:

Without details like these it must be URLS to wikipedia or Wolfram. 
Usual users don't know how to search wolfram.

--

___
Python tracker 
<http://bugs.python.org/issue21046>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21046] Document formulas used in statistics

2014-05-15 Thread Alextp

Alextp added the comment:

@Ezio:
of course, much of these funcs CANNOT be expressed as simple formulas. Only 
with some text. I shown example descriptions for almost all- above.

--

___
Python tracker 
<http://bugs.python.org/issue21046>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com