comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Q: Quantil calculation in IDL?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Q: Quantil calculation in IDL? [message #17523 is a reply to message #17379] Fri, 15 October 1999 00:00 Go to previous messageGo to previous message
J.D. Smith is currently offline  J.D. Smith
Messages: 214
Registered: August 1996
Senior Member
Joerg Mosthaf wrote:
>
> Hi,
> I have been searching the help files and David Fannings great book, but I can't
> find a way to calculate 25%- and 75%-quantils. Unfortunately I don't know the
> english name for this so let me explain: A 75%-quantil is like the median, but
> with 75% instead of 50% i.e. the number in a data spread, that 75% of all
> data points are less or equal to. Is there a way to do this fast on an
> 256x256 array? I need it to cut off noise at a specific level and to get a
> reliable min/max value, not including data spikes. I am probably overlooking
> something very easy, but I just couldn't find it.
>
> Thanks,
> Joerg Mosthaf

You can of course fully sort the data and then select element p(N-1) of
the sorted array where p is your quantile percentage and N is the number
of elements in your array.

However, if you're really looking for speed, you may need to consider a
*selection* routine (not provided with IDL). The advantage of selection
over sorting is that you don't care if everything is in order, just that
everything less than the nth largest is to the left of it, everything
greater is to the right, in any order. You gain as the log(N) over an
optimized full sort. Numerical Recipes provides a nice selection
routine, but it probably would be slower than sorting if translated to
IDL. Compiling in C or Fortran and linking into IDL would provide the
speed-up.

JD


--
J.D. Smith |*| WORK: (607) 255-5842
Cornell University Dept. of Astronomy |*| (607) 255-6263
304 Space Sciences Bldg. |*| FAX: (607) 255-5875
Ithaca, NY 14853 |*|
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Velocity vectors on maps
Next Topic: DAY OF YEAR

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:15:05 PDT 2025

Total time taken to generate the page: 0.00489 seconds