function s = ginimd(data)
%Normalized Gini Mean Difference 
% Naive Algorithm
%x =randn(1, 200);
%s = ginimd(x)
%

data=data(:);
n = length(data);

gini = 0;
for (i = 1:(n-1))
    for (j = (i+1):n)
        gini = gini + abs(data(i) - data(j));
    end
end
gini = gini/nchoosek(n,2);
s = gini * sqrt(pi)/2
