Re: locate a value in an array
- From: e p chandler <epc8@xxxxxxxx>
- Date: Mon, 28 Jan 2008 08:34:59 -0800 (PST)
On Jan 28, 3:48 am, Klemens <jokulhl...@xxxxxx> wrote:
Hello together,
I have computed a bootstrap analysis spending most of the time in this
part where the bootstrap pdf is resampled.
Some random numbers are generated (n = 1000000) and these numbers pick
the bin from the cdf.
These picking is done in a loop starting at the lowest bin and stoping
when the respective bin has been found.
Because its the cdf, bins are not equidistant. The number of bins of
the cdf is 1000.
There is a great number of repetitions (n), so some precalculations
could be worth to do if the overall time of this part of the code
could be reduced. Are there any advanced techniques to locate the
value's position in the cdf like subdividing the cdf, etc ... ?
Thanks for your help in advance !
Cheers,
Klemens
1. It appears that you have (at least) an ESTIMATE of your CDF.
Compute an approximate inverse function to your CDF and use the so
called "probability integral transform":
Generate a uniform random on (0,1) = U. Calculate Z= CDF-inverse(U) as
the random variable (Z) desired. Go from there.
2. See other methods such as "Walker's Alias Method" for sampling from
a known tabulated density.
HTH
-- e
.
- Follow-Ups:
- Re: locate a value in an array
- From: Klemens
- Re: locate a value in an array
- References:
- locate a value in an array
- From: Klemens
- locate a value in an array
- Prev by Date: Re: binary of gcc and gfortran shapshot 20080125 for windows
- Next by Date: Re: binary of gcc and gfortran shapshot 20080125 for windows
- Previous by thread: Re: locate a value in an array
- Next by thread: Re: locate a value in an array
- Index(es):
Relevant Pages
|
|