-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathplot_figures.m
60 lines (53 loc) · 1.71 KB
/
plot_figures.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
function plot_figures(samples, max_T, params)
% plot_figures plots the parameter estimates
% -------------------------------------------------------------------------
% INPUTS
%
% - samples: struct with the kernel parameter posterior estimates
% - max_T: the maximum time for observed events for all processes
% - params: model parameters
%
% OUTPUTS
%
% Returns the plot.
%
% -------------------------------------------------------------------------
% Copyright (C) Xenia Miscouridou, University of Oxford
% October 2018
%--------------------------------------------------------------------------
niter = params.niter;
nburn = floor(2*niter/3);
nsamples=params.nsamples;
thin = ceil((niter-nburn)/nsamples);
%get nchains
figure;
subplot(2,1,1);
for i =1:params.nchains
plot(thin:thin:(niter-nburn), squeeze(samples(i).eta(thin:thin:(niter-nburn)))/squeeze(samples(i).delta(thin:thin:(niter-nburn))));
ylabel('eta/delta')
% xaxis
hold all;
end
subplot(2,1,2);
for i =1:params.nchains
plot(thin:thin:(niter-nburn), squeeze(samples(i).eta(thin:thin:(niter-nburn))));
ylabel('eta')
hold all;
end
figure;
subplot(2,1,1);
for i =1:params.nchains
plot(thin:thin:(niter-nburn),squeeze(samples(i).delta(thin:thin:(niter-nburn))));
hold on;
ylabel('delta')
hold all;
end
subplot(2,1,2);
for i =1:params.nchains
plot(thin:thin:(niter-nburn), squeeze(samples(i).eta(thin:thin:(niter-nburn)).*samples(i).delta(thin:thin:(niter-nburn))/max_T));
hold on;
ylabel('eta/delta')
hold all;
end
end