Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
|||
USING: assocs formatting kernel math math.functions
|
||||
math.statistics random sequences sorting ;
|
||||
|
||||
2,000,000 [ 0 1 normal-random-float ] replicate ! make data set
|
||||
dup [ mean ] [ population-std ] bi ! calculate and show
|
||||
"Mean: %f\nStdev: %f\n\n" printf ! mean and stddev
|
||||
|
||||
[ 10 * floor 10 / ] map ! map data to buckets
|
||||
histogram >alist [ first ] sort-with ! create histogram sorted by bucket (key)
|
||||
dup values supremum ! find maximum count
|
||||
[
|
||||
[ /f 100 * >integer ] keepd ! how big should this histogram bar be?
|
||||
[ [ CHAR: * ] "" replicate-as ] dip ! make the bar
|
||||
"% 5.2f: %s %d\n" printf ! print a line of the histogram
|
||||
] curry assoc-each
|
||||
Loading…
Add table
Add a link
Reference in a new issue