]> gitweb.factorcode.org Git - factor.git/commitdiff
math.statistics: Rename full-* to population-*. Full, while somewhat descriptive...
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 5 Nov 2012 16:43:46 +0000 (08:43 -0800)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 8 Nov 2012 06:53:52 +0000 (22:53 -0800)
basis/math/statistics/statistics-docs.factor
basis/math/statistics/statistics.factor

index a4cb761c314d1476ad8fd8a3573684131e3b9a83..8f953c2bf3081f4b5f2c69069cad2d2b13411b52 100644 (file)
@@ -294,7 +294,7 @@ ARTICLE: "math.statistics" "Statistics"
 
 ABOUT: "math.statistics"
 
-{ var population-var sample-var } related-words
-{ std population-std sample-std } related-words
-{ ste population-ste sample-ste } related-words
-{ corr population-corr sample-corr } related-words
+{ var var-ddof population-var sample-var } related-words
+{ std std-ddof population-std sample-std } related-words
+{ ste ste-ddof population-ste sample-ste } related-words
+{ corr corr-ddof population-corr sample-corr } related-words
index c94565482ffb416af10dba3c046b80d5159b1b7c..838241061ed87cc5822506ad134a59546be3e681 100644 (file)
@@ -371,6 +371,10 @@ ALIAS: corr sample-corr
     [ dup mean v-n ] [ std ] bi
     dup zero? [ drop ] [ v/n ] if ;
 
+: standardize-2d ( u -- v )
+    flip dup [ [ mean ] [ std ] bi 2array ] map
+    [ [ first v-n ] 2map ] keep [ second v/n ] 2map flip ;
+
 : differences ( u -- v )
     [ 1 tail-slice ] keep [ - ] 2map ;