Skip to content

Commit

Permalink
changes to block size calculations
Browse files Browse the repository at this point in the history
minor change to algorithms that calculate blocks sizes for block bootstrap
  • Loading branch information
acp29 committed Mar 13, 2022
1 parent 8acee41 commit 439f017
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion inst/helper/boot2.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
% Prepare for block resampling (if applicable)
if ~isempty(blocksize)
x1 = cat_blocks(S.nvar,X1{:});
blocksize = round(blocksize/2);
blocksize = fix(blocksize/2);
X1 = split_blocks(x1,opt.blocksize,blocksize);
nvar = S.nvar * blocksize;
g = ones(n,1);
Expand Down
2 changes: 1 addition & 1 deletion inst/ibootci.m
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@
end
if strcmpi(blocksize,'auto')
% Set block length
blocksize = max(1,round(n^(1/3)));
blocksize = fix(n^(1/3))+1; % in the order of n^(1/3); round up to the nearest integer
end
data = split_blocks(data,n,blocksize);
bootfun = @(varargin) auxfun(bootfun,S.nvar,varargin);
Expand Down

0 comments on commit 439f017

Please sign in to comment.