Author: | mrjbq7 |
---|---|
Mode: | factor |
Date: | Tue, 23 Sep 2008 06:00:19 |
: sma ( seq n -- newseq ) #! Simple moving average 0 swap rot V{ } -roll [ [ length ] keep 2over <= rot drop ] [ [ <slice> sum ] 3keep [ [ 1+ ] dip 1+ ] dip roll [ roll ] dip swap [ push ] keep -roll ] [ drop drop drop ] while ;
Author: | mrjbq7 |
---|---|
Mode: | factor |
Date: | Tue, 23 Sep 2008 06:04:47 |
: sma ( seq n -- newseq ) #! Simple moving average clump [ mean ] map ;