Re: [R] Sampling of non-overlapping intervals of variable length

2009-07-19 Thread Moshe Olshansky
(assuming, as stated above, that the total length of all the intervals is a small proportion of the length of the "big interval"). --- On Mon, 20/7/09, Hadassa Brunschwig wrote: > From: Hadassa Brunschwig > Subject: Re: [R] Sampling of non-overlapping intervals of variab

Re: [R] Sampling of non-overlapping intervals of variable length

2009-07-19 Thread Hadassa Brunschwig
Thanks Chuck. Ups, did not think of the problem in that way. That did exactly what I needed. I have another complication to this problem: I do not only have one vector of 1:1e^6 but several vectors of different length, say 5. Initially, my intervals are distributed over those 5 vectors and the ra

Re: [R] Sampling of non-overlapping intervals of variable length

2009-07-19 Thread Charles C. Berry
On Sun, 19 Jul 2009, Hadassa Brunschwig wrote: Hi I am not sure what you mean by sampling an index of a group of intervals. I will try to give an example: Let's assume I have a vector 1:100. Let's say I have 10 intervals of different but known length, say, c(4,6,11,2,8,14,7,2,18,32). For si

Re: [R] Sampling of non-overlapping intervals of variable length

2009-07-19 Thread David Winsemius
On Jul 19, 2009, at 3:11 PM, Hadassa Brunschwig wrote: Hi I am not sure what you mean by sampling an index of a group of intervals. I will try to give an example: If you had a dataframe of the following sort: dfint start stop 3 7 12 20 40 45 60 72 And you wanted to gen

Re: [R] Sampling of non-overlapping intervals of variable length

2009-07-19 Thread Hadassa Brunschwig
Hi I am not sure what you mean by sampling an index of a group of intervals. I will try to give an example: Let's assume I have a vector 1:100. Let's say I have 10 intervals of different but known length, say, c(4,6,11,2,8,14,7,2,18,32). For simulation purposes I have to sample those 10 interv

Re: [R] Sampling of non-overlapping intervals of variable length

2009-07-19 Thread David Winsemius
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 inter