This repository has been archived on 2021-05-17. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
scientificComputing/statistics-fabian/scripts/bootstrap_mean.m
2015-10-15 18:18:56 +02:00

14 lines
258 B
Matlab

load thymusglandweights.dat
x = thymusglandweights(1:50);
m = 500;
n = length(x);
mu = zeros(m,1);
for i = 1:m
mu(i) = mean(x(randi(n,n,1)));
end
fprintf("bootstrap standard error: %.4f\n", std(mu));
fprintf("standard error: %.4f\n", std(x)/sqrt(n));