simionx.Statistics - Statistics utility functions¶
SYNOPSIS¶
local Stat = require "simionx.Statistics"
-- Generate table of uniform Gaussian random numbers.
local t = {}
for n=1,10000 do t[#t+1] = Stat.gaussian_rand() end
-- Compute mean and standard deviation.
print("mean", Stat.array_mean(t)) --> "mean 0.011016404779235"
print("stdev", Stat.array_stdev(t)) --> "stdev 0.99160454577423"
-- Generate histogram.
local hist = Stat.make_histogram{data=t, nbins=10}
print(hist)
--[[OUTPUT:
{npoints=10000,nbins=10,binmin=-4.382378,binmax=4.488155,\
binsize=0.887053,centerbins=true,normalize=true}
-3.938851,0.000451
-3.051798,0.004171
-2.164745,0.039682
-1.277692,0.180823
-0.390638,0.351839
0.496415,0.356912
1.383468,0.157826
2.270521,0.030776
3.157575,0.004622
4.044628,0.000225
]]
DESCRIPTION¶
This module provides various statistical functions.
Note
This page is abridged from the full SIMION "Supplemental Documentation" (Help file). The following additional sections can be found in the full version of this page accessible via the "Help > Supplemental Documentation" menu in SIMION 8.1.1 or above:INTERFACE
SOURCE¶
version: 20130222