On Sun, 22 Sep 2019, Sven Schreiber wrote:
Am 22.09.2019 um 01:52 schrieb Allin Cottrell:
> If so, it appears they're not doing random sampling, they're considering
> all contiguous sub-samples of a certain size.
...
>
> There's nothing random here and it would be easy to generate such
> subsets in hansl without the help of any special function.
I agree on the non-randomness with respect to all possible subsets.
> Randomness might come in at a "meta" level if one wanted to select a
> random subset of the full set of such samples -- presumably, without
> replacement.
Yes, that's how I understood the randomness coming in.
That could be done easily using msample() on a vector of
> contiguous index values (just {1,2,3,4,5} for the toy case above). Given
> the selected indices, getting the samples would then be a simple
> deterministic calculation.
Not sure I understand that. Previously you said that taking blocks
without replacement would be tricky. Now you say it's simple?
In the Politis and Romano case under consideration, they're doing an
analysis that involves calculating a certain statistic m times, for
each of m contiguous subsamples of length b from the full data.
They're fine with these subsamples overlapping, and they're not
sticking them together into a combined sample of size m*b. As they
say, there will always be n - b + 1 such subsamples available. My
observation was just that if m < n subsamples were judged "enough" for
the job, one could easily select m of them using msample() on their
indices (the index for each subsample just being the observation at
which it starts). I mean (trivial example, for a matrix X with n
rows):
sample_starts = seq(1,n-b+1)
samples_used = msample(sample_starts, m)
matrices samples = array(m)
loop j=1..m
istart = samples_used[i]
istop = istart + b - 1
samples[i] = X[istart:istop,]
endloop
This is quite different from the case I couldn't get my head around,
namely drawing a single sample of size m > b with block length b and
no replacement of observations (and so no overlap of blocks).
Allin