Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Idl-pvware > Re: 5th & 95th ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 5 Topic 5426 of 6249
Post > Topic >>

Re: 5th & 95th Percentiles

by Maarten <maarten.sneep@[EMAIL PROTECTED] > Feb 14, 2008 at 01:04 AM

On Feb 13, 5:04 pm, Spon <christoph.b...@[EMAIL PROTECTED]
> wrote:

> pc5  = Data( (SORT(Data) ) (5 * N_ELEMENTS(Data) / 100) )
> pc95 = Data( (SORT(Data) ) (95 * N_ELEMENTS(Data) / 100) )

Please use

compile_opt defint32, strictarr

or

compile_opt idl2

at the beginning of each function (and in your IDL startup script) and
square braces for readability. For me at least it makes my head spin.
Consider the following instead:

pc5  = Data[ (SORT(Data))[5 * N_ELEMENTS(Data) / 100] ]

At least now it is clear which is which (array indexing vs. function
calling).

If you need both pc5 and pc95, be sure to store the sorted index:

sidx = sort(data)
ndata = n_elements(data)
pc5 = data[sixd[5*ndata / 100]]
pc66 = data[sixd[66*ndata / 100]]

Maarten
 




 5 Posts in Topic:
5th & 95th Percentiles
chloesharrocks@[EMAIL PRO  2008-02-13 07:58:14 
Re: 5th & 95th Percentiles
Vince Hradil <hradilv@  2008-02-13 08:10:41 
Re: 5th & 95th Percentiles
chloesharrocks@[EMAIL PRO  2008-02-13 08:19:22 
Re: 5th & 95th Percentiles
Spon <christoph.blau@[  2008-02-13 09:04:55 
Re: 5th & 95th Percentiles
Maarten <maarten.sneep  2008-02-14 01:04:19 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 6:36:28 CDT 2008.