[Rd] Bug/Wishlist: 'partial' in 'sort' and 'quantile' (PR#8650)

roger koenker roger at ysidro.econ.uiuc.edu
Sun Mar 5 19:28:31 CET 2006


I used to have a version of the classical Floyd and Revest "Select"  
algorithm (ACM#489)
for computing  univariate quantiles in my quantreg package.  At some  
point
g77 decided that it shouldn't be possible to use recursion  in  
fortran and I had
to remove it.  Stimulated by my your recent inquiry,  I thought I  
would see
whether it could be revived.  At least on my macs, running gfortran,  
it seems
that recursion is now again permissible.  I've not done any serious  
testing, but
I get:

 > unix.time(kuantile(y))  #my fortran translation of the Floyd- 
Revest algol algorithm
[1] 0.56 0.41 0.96 0.00 0.00
 > unix.time(median(y))
[1] 1.80 0.27 2.07 0.00 0.00
 > length(y)
[1] 10000000

for a rnorm example.  I'd be happy to provide some new version of  
this, but
I'm afraid that there are still lots of g77 users, including on macs,  
that
wouldn't be functional due to the recursion.  Any thoughts on this  
would  be
appreciated.  Brian is doubtless right that current methods are  
perfectly
adequate for almost all purposes, but in cases of very large datasets  
where
many quantiles are needed, it may be worthwhile.

Roger

url:    www.econ.uiuc.edu/~roger                Roger Koenker
email   rkoenker at uiuc.edu                       Department of Economics
vox:    217-333-4558                            University of Illinois
fax:    217-244-6678                            Champaign, IL 61820



More information about the R-devel mailing list