math: Revert clone on median algorithm, perhaps need to revisit this. Call clump for moving-median
parent
31e1fe54e3
commit
5224fba820
|
@ -151,7 +151,6 @@ PRIVATE>
|
|||
bi kth-smallests first2 ;
|
||||
|
||||
: median ( seq -- x )
|
||||
clone
|
||||
dup length odd? [ lower-median ] [ medians + 2 / ] if ;
|
||||
|
||||
! quantile can be any n-tile. quartile is n = 4, percentile is n = 100
|
||||
|
|
|
@ -99,7 +99,7 @@ PRIVATE>
|
|||
[ 1 ] 2dip [ [ dupd swap - ] dip * + dup ] curry map nip ;
|
||||
|
||||
: moving-median ( u n -- v )
|
||||
<clumps> [ median ] map ;
|
||||
clump [ median ] map ;
|
||||
|
||||
: moving-supremum ( u n -- v )
|
||||
<clumps> [ supremum ] map ;
|
||||
|
|
Loading…
Reference in New Issue