Content-type: text/html Man page of NADDI


Section: User Commands (1)
Updated: Jun 20 2006
Index Return to Main Contents


naddi - compute distribution  




Compute "naddi" data distribution index. Reads pairs of numbers separated by whitespace. First number: the value, second number: the frequency.


echo -e "10000 10\n1000 10\n5000 20\n" | naddi


-a, --average
Print the total value, the number of elements, and the element value average (in that order).
-dDIVIDE[%], --divide=DIVIDE[%]
Use another fraction for --extreme, --extreme-index and --share then the default 50%. With `%' assumes a percentage, without `%' a fraction between 0 and 1.
-e, --extreme
Print the minimum, the DIVIDE%, and maximum element values.

The DIVIDE% element is the first element encountered in the input, which makes the number of elements so far encountered, larger or equal then DIVIDE% of the total number of elements. DIVIDE% is 50% unless otherwise specified by --divide=DIVIDE. Sort(1) input on numerical value.

-E, --extreme-index
Print element distribution minimum, DIVIDE% and maximum, as fractions. (See --divide.) Sort(1) input on numerical value.
-f, --fraction
Print distribution index as fraction.
Print distribution algorithm.
Print --share in `The top ...% corresponds to ...', give 2 times for `The bottom ...% ...'.
-h, --help
Print usage.
-oVALUE, --offset=VALUE
Give an offset for all values before computing the distribution index.

--offset=0 is special: it adjusts all values equally, so that the minimum element value is 0.

-pN, --precision=N
Set the precision (program uses `long double' data type, which is not infinite).
-s, --share
Total value encountered in the input stream, until the DIVIDE% value, which is added to the share proportionally. Prints in the same format (fraction or percentage) as the --divide argument was given in. Sort(1) input on numerical value.
Print version.
-v[N], --verbose[=N]
Verbose level, max 4.


negative values

If a value is negative, all values are adjusted upwards until the minimum value is 0 when computing the distribution index (the formula does not handle negative numbers properly). The negative adjustment is determined before --offset has taken effect.  


Returns 0 on success, 1 for input error, 2 for computation error, 3 for system error.  


This software is released under the terms of the Free Software Foundation's `General Public Licence' (GPL). This License is Copyrighted by Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

This utility comes without any warranty whatsoever.  


Report bugs to

Anomaly when using --offset:

Usually the index is expected to be closer to 100% if all values are adjusted upwards. However, relatively close to --offset=0, sometimes the index falls first slightly (up to about 1%) for an increased --offset, reaches a minimum, and then increases as expected. This is probably because slight increases of values near zero and therefore their element-distribution indexes also near zero, do not have any effect on the outcome with a higher --offset yet, whereas the changes of larger values takes an effect immediately for a rising offset. This will make the high indexes go up while the low indexes remain practically `near zero', resulting in a greater disparity between high and low element indexes, which results in a "less equal" distribution index (lower index).  


Jos Boersema




This document was created by man2html, using the manual pages.
Time: 09:02:52 GMT, November 28, 2007