quantile-abcd ( seq qs a b c d -- quantile )


Vocabulary
math.statistics

Inputs
seqan object
qsan object
aan object
ban object
can object
dan object


Outputs
quantilean object


Definition


:: quantile-abcd ( seq qs a b c d -- quantile )
seq qs a b quantile-indices :> indices indices
[ [ floor 0 max ] [ ceiling seq length 1 - min ] bi 2array ]
map concat :> index-pairs seq index-pairs kth-smallests
2 group indices [ [ first2 ] dip c d qabcd ] 2map ;