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

Home » Public Forums » archive » Re: "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 #30847 is a reply to message #30844] Mon, 20 May 2002 13:58 Go to previous message
Wayne Landsman is currently offline  Wayne Landsman
Messages: 117
Registered: January 1997
Senior Member
> I have found:
>
> http://www.astro.washington.edu/deutsch-bin/getpro/library14 .html?PERMUTE
>
> which is a somewhat better way, but still slow. Is there a no-loops version?

Interesting question. I had modified the above PERMUTE program to use a
vector call to RANDOMN(/DOUBLE), (the /DOUBLE keyword has been available since
V5.4). My feeling was that with ~5e15 distinct double precision numbers
between 0 and 1, that probablity of RANDOMN returning two identical numbers was
vanishingly small, in a typical call of say less than 10,000 numbers

But I've never been comfortable enough with the modification to actually use
it. I suppose I should add a check for any equal numbers in the
RANDOMN(/DOUBLE) call, and then randomize those numbers.

--Wayne

FUNCTION PERMUTE,M, RSEED, OUTSEED = seed
;+
; NAME:
; PERMUTE
; PURPOSE:
; Randomly permute the elements of a vector
; USAGE:
; NewIndex = PERMUTE( M, [ InSeed, OUTSEED = ] )
; INPUT:
; M = length of vector
; OPTIONAL INPUT-OUTPUT:
; SEED = random number seed to be passed to RANDOMU
; Upon return, it will updated as a vector containing a new seed
; OUTPUT:
; PERMUTE returns M randomly shuffled integers between 0 and M-1
; EXAMPLE:
; To shuffle the elements of a vector V,
;
; V = V [ PERMUTE(N_ELEMENTS(V) ) ]
;
; REVISION HISTORY:
; Written, H.T. Freudenreich, HSTX, 2/95
; Use vectorized call W. Landsman SSAI December 2001
;-
;
; Select M numbers at random, repeating none.

if N_elements(rseed) GT 0 then seed = rseed
return, sort( randomn(seed, m,/Double) )
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Inconsistent Mean Calculation
Next Topic: sec : U Re: Problems importing IDL postscript from TV output into Adobe Illustrator

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

Current Time: Wed Oct 08 17:31:18 PDT 2025

Total time taken to generate the page: 0.00497 seconds