I run Gretl 1.10.0cvs build date: 05 Feb 2015 for Windows 64.
I need to use the function "ranking" on column vectors of numbers where
there will always be only two equal numbers, with all others distinct.
The one of the two equal numbers comes from a different calculation
path. The calculation of all these numbers involves natural logarithms.
The problem is that in order for the "ranking" function to recognize
the equality, and provide half-integer ranks as programmed, the two
numbers must be identical to whatever precision they are stored in Gretl.
In practice these two numbers are not totally identical. For example I
obtain
2.8841797876482436
and
2.8841797876482445
But the difference is an artifact of calculation -the two magnitudes
that are represented by these numbers are identical. The difference is
immaterial for all practical purposes -but the function "ranking",
performing as it is supposed to perform, gives rank 12 to the first and
13 for the second. But what I "should" get (so as to be consistent with
the theoretical quantities) is 12.5 and 12.5 . Moreover, it is not known
a priori which of the two will be slightly above or below the other.
A roundabout way to deal with the problem does exist: multiply by some
power of 10 representing desired precision in number of decimals, then
truncate using the function "int", then apply "ranking".
I was just wondering whether it would be worth the programming trouble
to enhance directly the "ranking" function so as to "look" only as
deep
as a user-specified number of decimals.
The same added functionality could be given to the function "round",
which currently only rounds to the nearest integer.
It could be a useful feature of Gretl in general, since it would give
the user the ability to specify what constitutes "equal" for his
specific situation, without the need to use the roundabout trick
described above.
--
Alecos Papadopoulos
Athens University of Economics and Business, Greece
Department of Economics
cell:+30-6945-378680
fax: +30-210-8259763
skype:alecos.papadopoulos