[bootstrap] added matplotlib figure for meandiff
This commit is contained in:
@@ -17,10 +17,12 @@ function meandiffplot(x, y, md, ds, dq, k, nrows)
|
||||
bmin = min([x; y]);
|
||||
bmax = max([x; y]);
|
||||
bins = bmin:(bmax-bmin)/20.0:bmax;
|
||||
hist(x, bins, 'facecolor', 'b');
|
||||
[xh, b] = hist(x, bins);
|
||||
[yh, b] = hist(y, bins);
|
||||
bar(bins, xh, 'facecolor', 'b')
|
||||
hold on
|
||||
hist(y, bins, 'facecolor', 'r');
|
||||
xlabel('x and y')
|
||||
bar(bins, yh, 'facecolor', 'r');
|
||||
xlabel('x and y [mV]')
|
||||
ylabel('counts')
|
||||
hold off
|
||||
|
||||
@@ -34,7 +36,7 @@ function meandiffplot(x, y, md, ds, dq, k, nrows)
|
||||
hold on;
|
||||
bar(b(b>=dq), h(b>=dq), 'facecolor', 'r');
|
||||
plot([md md], [0 4], 'r', 'linewidth', 2);
|
||||
xlabel('Difference of means');
|
||||
ylabel('Probability density of H0');
|
||||
xlabel('Difference of means [mV]');
|
||||
ylabel('pdf of H0');
|
||||
hold off;
|
||||
end
|
||||
|
||||
@@ -27,11 +27,11 @@ for k=1:length(mys)
|
||||
fprintf(' --> measured difference of means is not significant\n');
|
||||
end
|
||||
|
||||
subplot(length(mys), 2, k*2-1);
|
||||
title(sprintf('mx=%.1fmV, my=%.1fmV', mx, my))
|
||||
|
||||
%% (b), (f) plot histograms of data and pdf of differences:
|
||||
meandiffplot(x, y, md, ds, dq, k, length(mys));
|
||||
|
||||
subplot(length(mys), 2, k*2-1);
|
||||
title(sprintf('mx=%.1fmV, my=%.1fmV', mx, my))
|
||||
end
|
||||
|
||||
savefigpdf(gcf, 'meandiffsignificance.pdf', 12, 10);
|
||||
|
||||
BIN
bootstrap/exercises/meandiffsignificance.pdf
Normal file
BIN
bootstrap/exercises/meandiffsignificance.pdf
Normal file
Binary file not shown.
Reference in New Issue
Block a user