Hadassa Brunschwig
2009-Jul-19 17:05 UTC
[R] Sampling of non-overlapping intervals of variable length
Hi, I hope I am not repeating a question which has been posed already. I am trying to do the following in the most efficient way: I would like to sample from a finite (large) set of integers n non-overlapping intervals, where each interval i has a different, set length L_i (which is the number of integers in the interval). I had the idea to sample recursively on a vector with the already chosen intervals discarded but that seems to be too complicated. Any suggestions on that? Thanks a lot. Hadassa -- Hadassa Brunschwig PhD Student Department of Statistics The Hebrew University of Jerusalem http://www.stat.huji.ac.il
David Winsemius
2009-Jul-19 18:48 UTC
[R] Sampling of non-overlapping intervals of variable length
On Jul 19, 2009, at 1:05 PM, Hadassa Brunschwig wrote:> Hi, > > I hope I am not repeating a question which has been posed already. > I am trying to do the following in the most efficient way: > I would like to sample from a finite (large) set of integers n non- > overlapping > intervals, where each interval i has a different, set length L_i > (which is the number > of integers in the interval). > I had the idea to sample recursively on a vector with the already > chosen intervals > discarded but that seems to be too complicated.It might be ridiculously easy if you sampled on an index of a group of intervals. Why not pose the question in the form of example data.frames or other classes of R objects? Specification of the desired output would be essential. I think further specification of the sampling strategy would also help because I am unable to understand what sort of probability model you are hoping to apply.> Any suggestions on that? > > Thanks a lot. > > Hadassa > > > -- > Hadassa Brunschwig > PhD Student > Department of StatisticsDavid Winsemius, MD Heritage Laboratories West Hartford, CT