From 0c5f8953712979c2e6d008fc7c4df323df47910b Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 10 Jul 2012 17:03:01 -0700 Subject: [PATCH] math.statistics: minor style cleanup. --- basis/math/statistics/statistics.factor | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/basis/math/statistics/statistics.factor b/basis/math/statistics/statistics.factor index 4fb282ad05..ac414e8b2d 100644 --- a/basis/math/statistics/statistics.factor +++ b/basis/math/statistics/statistics.factor @@ -94,7 +94,7 @@ PRIVATE> PRIVATE> : kth-object ( seq k quot: ( x y -- ? ) -- elt ) - [ [ nth ] [ exchange ] ] dip (kth-object) ; inline + [ [ nth ] [ exchange ] ] dip (kth-object) ; inline : kth-objects ( seq kths quot: ( x y -- ? ) -- elts ) [ clone ] 2dip @@ -142,8 +142,7 @@ PRIVATE> bi kth-smallests first2 ; : median ( seq -- x ) - dup length odd? - [ lower-median ] [ medians + 2 / ] if ; + dup length odd? [ lower-median ] [ medians + 2 / ] if ; ! quantile can be any n-tile. quartile is n = 4, percentile is n = 100 ! a,b,c,d parameters, N - number of samples, q is quantile (1/2 for median, 1/4 for 1st quartile)