.Open Statistics
. Also See
.See ./math_81_Probabillity.html
. Online Statistics and Probability Calculators
.See http://easycalculation.com/statistics/statistics.php
.See http://statpages.org/
.See ../tools/stats.scm
(Local Scheme functions)
. Notes and definitions on statistics.
STATISTICS::=following,
.Net
. Definition of a (finite) sample
I :: Finite_Sets=given.
`I` standards for index. Typically it is a range 1..`n` where `n` is the sample size. However
in some languages/cultures `I` could be 0..`n`-1. In fact there is no reason to limit `I` to a range.
Any finite set of indices will work.
Sample::=I>->Real. Each index item has a measured value.
Example.
For example the list
(1,2,3)
has `I` = 1..3 and size=3.
size::Real= |I|.
n:=size. Local shorthand.
For p:Real, p::Sample = I +> p. A coercion that converts a single value into a sample with the same value for each index.
This turns out to be useful when we subtract the mean of
a sample (a number) from every item in the sample.
For x,y::$Sample I will use `x` and `y` as the names of samples of data.
. Statistics on one sample
mean(x)::= +x/n. In $STANDARD (+) is a serial operator that adds up all the items in its arguments.
+(1,2,3) = (1+2+3) = 6.
mean((1, 2, 3)) = +(1, 2, 3)/3 = 6/3 = 2.
min, max, range, mode, histogram are to be done.
.Hole stats1
ss(x)::=+(x*x). Sum of squares.
ss((1, 2, 3)) = +(1*1, 2*2 , 3*3) = +(1,4,9) = 14.
ms(x) ::= ss(x - mean(x) )/n. Mean squares about mean.
(-1)|- ms(x) =( ss(x) - (+x)*mean(x))/n.
Better for small hand calculations.
ms((1,2,3)) = (14 - 6*2)/3 = 2/3.
var(x)::= n * ms(x)/(n-1). Sample variance -- rescale to allow for estimating the mean.
root_mean_square(x)::=sqrt(ms(x)).
rms ::= root_mean_square.
standard_deviation(x)::=sqrt( var (x) ).
sd(x)::=standard_deviation(x).
. Statistics on Two samples
SP(x,y)::=+((x-mean(x))*(y-mean(y))).
(-1)|- ss(x) = SP(x,x).
MS(x,y)::=SP(x,y)/n.
r(x,y)::= MS(x,y)/( sd(x)*sd(y)). Correlation coefficient -- Pearson.
More...
.Hole stats2
.Close.Net STATISTICS
.Close Statistics in MATHS