Skip to content

Commit

Permalink
added calculation of mean of bootstrap distribution to 'stats' output…
Browse files Browse the repository at this point in the history
… argument
  • Loading branch information
acp29 committed May 15, 2024
1 parent b1a0b40 commit 6faab5d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions inst/bootstrp.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
% '[BOOTSTAT, BOOTSAM, STATS] = bootstrp (...)' also calculates and returns
% the following basic statistics relating to each column of BOOTSTAT:
% - original: the original estimate(s) calculated by BOOTFUN and the DATA
% - bias: bootstrap bias of the estimate(s)
% - mean: the mean of the bootstrap distribution(s)
% - bias: bootstrap bias estimate(s)
% - bias_corrected: original estimate(s) after subtracting the bias
% - var: bootstrap variance of the original estimate(s)
% - std_error: bootstrap standard error of the original estimate(s)
Expand Down Expand Up @@ -455,7 +456,8 @@
if (~ isempty (bootfun))
stats.original = reshape (bootfun (x{:}), 1, []);
try
stats.bias = bsxfun (@minus, mean (bootstat), stats.original);
stats.mean = mean (bootstat);
stats.bias = bsxfun (@minus, stats.mean, stats.original);
stats.bias_corrected = bsxfun (@minus, stats.original, stats.bias);
stats.var = var (bootstat, 0);
stats.std_error = sqrt (stats.var);
Expand Down

0 comments on commit 6faab5d

Please sign in to comment.