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

Home » Public Forums » archive » "bootstrap" statistics
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: "bootstrap" statistics [message #30929 is a reply to message #30849] Mon, 27 May 2002 12:55 Go to previous messageGo to previous message
Wayne Landsman is currently offline  Wayne Landsman
Messages: 117
Registered: January 1997
Senior Member
wmc@bas.ac.uk wrote:

> Med Bennett <mwbennett@windra.com> wrote:
>> The way to do this without using the same value more than once is to use the sort
>> command. First, generate m uniform random numbers, then find the sort indices of
>> the random numbers. For example, if you want to randomly pick 50 out of 100
>> values:
>
>> IDL> junk = randomu(seed,100)
>> IDL> s=sort(junk)
>> IDL> print,s[0:49]
>
> Ah. Yes. Clever. (I have a feeling thats what one other post was trying to tell
> me but wasn't so clear).

Though the above method gives distinct values, they may not be completely random if
the original RANDOMU() call returns duplicate values. The behaviour of the
SORT() command when encountering duplicate values differs on different machine
architectures, but on many machines the original array order is maintained (e.g.
SORT([4,3,4,4,2]) returns [4,1,0,2,3]. This introduces a bias, where lower
indicies are more likely to occur at the beginning of the permutation vector, and
thus may bias a result that depends on completely random permuations.

However, the likelihood of RANDOMU returning duplicate values seems quite small for
reasonable (<10,000?) sizes, and will be even smaller if the /DOUBLE keyword is used.

Cheers , --Wayne Landsman
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Job offer for IDL Programmers near Frankfurt/Germany
Next Topic: peculiar things with Z-device

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

Current Time: Wed Oct 08 13:35:36 PDT 2025

Total time taken to generate the page: 0.00523 seconds