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

Home » Public Forums » archive » Resampling from cumulative probability distribution
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Resampling from cumulative probability distribution [message #58349] Sat, 26 January 2008 06:09
Klemens is currently offline  Klemens
Messages: 18
Registered: April 2007
Junior Member
Hallo together,

I am computing a bootstrap analysis where the resampling routine from
a cumulative probability distribution needs the most cpu time. May be
you have some ideas how to eliminate the loop and speed up the
routine ...

function get_bootstrap_pdf, np, cdf

zz = randomu(S, np) ; np is the number of
samples

cdfa = cdf[0:n_elements(cdf)-2] ; cdf is the cumulative
probability distribution
cdfb = cdf[1:n_elements(cdf)-1]

b = fltarr(n_elements(cdf)) ; b will be the
resampled distribution
b[*] = 0.00

for i = 0, n_elements(cdf)-2 do begin ;
loop through all bins
index = where((zz ge cdfa[i]) and (zz lt cdfb[i]))
if (max(index) ge 0) then begin
b[i] = n_elements(index)
endif else begin
b[i] = 0.00
endelse
endfor

total_b = total(b)
b = b / total(b)

return, b

end

Thanks for your help in advance !

Klemens
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Simple File I/O
Next Topic: Re: Choosing Mercator Map Projections

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

Current Time: Wed Oct 08 17:32:57 PDT 2025

Total time taken to generate the page: 0.00647 seconds