-
Notifications
You must be signed in to change notification settings - Fork 6
/
plot_hist_from_files.m
44 lines (32 loc) · 1015 Bytes
/
plot_hist_from_files.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
% Plot script for histograms.
% Read these values from a file
% name = 'Stretch move';
% totalSamples = 1000000;
% K = 100;
% M = totalSamples / K;
% N = 10;
% pdf_num
% Run the parameter load script
load_parameters
totalSamples = M * K;
numSaved = length(indicesToSave);
% look at each of the saved variables
for j = 1:numSaved
idx = indicesToSave(j) ;
% get the precomputed historgram data
eval(sprintf('histogram_data_%d', idx));
figure ;
% Swap these lines to add error bars
% errorbar(centers, fhat, sigma_f_hat, 'r') ;
bar(centers, fhat, 1.0) ;
hold on
title(sprintf('%s run:\nHistogram of X_{%d} of %d\nSteps, M = %d, Number of walkers = %d, Total Samples = %d', ...
name, idx, N, M, K, totalSamples));
legend('Histogram of samples');
hold off
end
% scatter plot for 2d dimensions
if ((N == 2) && (numSaved == 2))
figure;
plot(samples(1,:), samples(2,:), '.k', 'MarkerSize', 0.001) ;
end