Skip to content

Commit 6faab5d

Browse files
committed
added calculation of mean of bootstrap distribution to 'stats' output argument
1 parent b1a0b40 commit 6faab5d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

inst/bootstrp.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@
8787
% '[BOOTSTAT, BOOTSAM, STATS] = bootstrp (...)' also calculates and returns
8888
% the following basic statistics relating to each column of BOOTSTAT:
8989
% - original: the original estimate(s) calculated by BOOTFUN and the DATA
90-
% - bias: bootstrap bias of the estimate(s)
90+
% - mean: the mean of the bootstrap distribution(s)
91+
% - bias: bootstrap bias estimate(s)
9192
% - bias_corrected: original estimate(s) after subtracting the bias
9293
% - var: bootstrap variance of the original estimate(s)
9394
% - std_error: bootstrap standard error of the original estimate(s)
@@ -455,7 +456,8 @@
455456
if (~ isempty (bootfun))
456457
stats.original = reshape (bootfun (x{:}), 1, []);
457458
try
458-
stats.bias = bsxfun (@minus, mean (bootstat), stats.original);
459+
stats.mean = mean (bootstat);
460+
stats.bias = bsxfun (@minus, stats.mean, stats.original);
459461
stats.bias_corrected = bsxfun (@minus, stats.original, stats.bias);
460462
stats.var = var (bootstat, 0);
461463
stats.std_error = sqrt (stats.var);

0 commit comments

Comments
 (0)