Folks,
as a preliminary step towards fixing #1855731, I re-wrote the quantile()
function in a much more efficient way. Example script:
<script>
nulldata 1000000
set seed 34789023
x = round(normal()*100)/100
# insert a few missing values here and there
# as a robustness check
m = uniform()<0.05
x = m ? NA : x
set stopwatch
loop for (p=0.05; p<0.99; p+=0.05)
q = quantile(x, p)
printf "q = %5.2f\n", q
end loop
et = $stopwatch
</script>
results are the same as with the old function, but speed is about 10 times
higher. I ran quite a few tests, and it seems that results are correct;
however, you can never be too cautious, so if you could test the
quantile() implementation you find in CVS and report any bugs you find,
that would be very helpful.
Thanks.
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti