Statistics
Here we take 50 samples of size thirty from a uniform population on [1,5] and compute the means of the samples.
> u:=samplemeansUniform(1,5,30,50);
This uniform distribution has a mean of 3. and a standard deviation of 1.154700539 Here are means of 50 random samples of size 30 from this distribution.
Here are some basic statistics for these means followed by a histogram.
> tu:=basicstats(u,1);
statistics calculated values ---------------------------------------------------------- count 50 mean 2.964757726 median 2.972008309 mode no mode range 2.454975466..3.450102968 sample std dev .2244880120 3rd quartile 3.083203689 1st quartile 2.794465651
> freqhistogram(u,7,` `,blue);
You can work with several discrete distributions or you can create your own. Here is a user defined distribution.
> discreteprobdist([[0,1,2,3,4],[0.1,0.2,0.2,0.1,0.4]]);
x prob(x) x*prob(x) ((x - mean)^2)*prob(x) --------------------------------------------------------------- 0 .1 0 .625 1. .2 .2 .450 2. .2 .4 .50E-1 3. .1 .3 .25E-1 4. .4 1.6 .900 SUM 1.0 2.5 2.050 mean variance 1.431782106 standard deviation
Here is a histogram with a normal curve superimposed.
> binomhistogram(20,.4, 1);
You can work with continuous distributions.
> n:=normaldist(0,1);
> tf:=tdist(8);
> plot([tf(x),n(x)],x=-3..3,title=`Normal in blue t with df=8 in red`,color=[red,blue]);