Am 24.10.2017 um 19:06 schrieb Sven Schreiber:
Am 24.10.2017 um 18:38 schrieb Allin Cottrell:
>>>>> Am 24.10.2017 um 14:36 schrieb Sven Schreiber:
>>>>>> number, if you know what I mean. In the original code (now in
>>>>>> SBslow()) this looks different.
> I'm sure Sheppard is right (and so Artur's SB is also right). If you
> used a single random value for both (i) the decision on whether to
> start a new block or select a consecutive value and (ii) to select the
> starting point for a new block, then your blocks would always start in
> the initial 1/b fraction of the data (where b = expected block size).
> And surely you don't want that.
Fair enough. My question all along has been whether Artur's algorithm
and/or Sheppard's handout were equivalent conceptually to some other
implementations that I (only briefly) looked at -- including the
previous SBslow code by Stefano et al., and also some part in Sheppard's
MFE toolbox that I _thought_ was about the stationary bootstrap and that
was different from the handout.
Hi Sven, this is from Sheppard's MFE toolbox and the relevant snippet
from the code doing the stationary bootstrap. Even though computation is
done without using loops, it does exactly what the SB() function does:
Use rand() initially to determine the selection vector, before using
another rand() for selecting the starting obs. of the new (random)
sub-block.
<MFE>
% Initial positions
indices(1,:)=ceil(t*rand(1,B));
% Set up the random numbers
select=rand(t,B)<p;
indices(select)=ceil(rand(1,sum(sum(select)))*t);
</MFE>
Artur