(gini) ( seq -- x )


Vocabulary
math.extras.private

Inputs
seqan object


Outputs
xan object


Definition


:: (gini) ( seq -- x )
seq sort :> sorted seq length :> len sorted 0
[ + ] cum-reduce :> ( a b ) b len a * / :> c 1 len recip +
2 c * - ;