math.statistics: Add trimean.
parent
cfb44999a1
commit
49c0b12b33
|
@ -230,3 +230,5 @@ IN: math.statistics.tests
|
|||
{ 1 2 3 4 5 10 21 12 12 12 12203 3403 030 3022 2 2 }
|
||||
{ 1/1000 } quantile5
|
||||
] unit-test
|
||||
|
||||
{ 15+1/2 } [ { 4 8 15 16 23 42 } trimean ] unit-test
|
||||
|
|
|
@ -205,6 +205,9 @@ PRIVATE>
|
|||
: quartile ( seq -- seq' )
|
||||
{ 1/4 1/2 3/4 } quantile5 ;
|
||||
|
||||
: trimean ( seq -- x )
|
||||
quartile first3 [ 2 * ] dip + + 4 / ;
|
||||
|
||||
<PRIVATE
|
||||
|
||||
: (sequence>assoc) ( seq map-quot insert-quot assoc -- assoc )
|
||||
|
|
Loading…
Reference in New Issue