-
Notifications
You must be signed in to change notification settings - Fork 0
/
MCMCNottinghamPhageCompareEven.m
56 lines (49 loc) · 2.24 KB
/
MCMCNottinghamPhageCompareEven.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
function [abcValuesSing, abcValuesBoth] = ...
MCMCNottinghamPhageCompareEven(protocolFile, dataFile, sucesses, ...
reportWindow, acceptError1, acceptError2, compMode, savePlot)
% Run the MCMC progress to attempt to fit paramters for observed data.
% For single predator only and dual predation & compare them
%
% Data and information on priors are read in from the data and protocol
% files
%
% function [abcValuesSing, abcValuesBoth] = ...
% MCMCNottinghamPhageCompareEven(protocolFile, dataFile, sucesses, ...
% reportWindow, acceptError1, acceptError2, compMode, savePlot)
%
% abcValuesSing - The different parameter settings tried that passed the
% threshold for acceptance match to single predator data only
% abcValuesBoth - The different parameter settings tried that passed the
% threshold for acceptance match to all data
%
% protocolFile - The parameters for the fitting process
% dataFile - Data to fit to
% success - The number of sucesses needed
% reportWindow - Show acceptance percentage over the last this many tries
% acceptError1 - Factor by which to adjust parameter acceptance threshold
% for single predator only data
% acceptError2 - Factor by which to adjust parameter acceptance threshold
% for all data
% compMode - How should simulated and observed data be compared?
% savePlot - Should the plots be saved
% Version Author Date Affiliation
% 1.00 J K Summers 10/09/17 Kreft Lab - School of Biosciences -
% University of Birmingham
%
tic
params = readtable(protocolFile);
numParams = params.numParams(1);
paramNames = params.paramNames(1: numParams);
plotTitle = ['Even ' char(params.plotName(1)) char(params.trueTitles(1)) ...
' AR1' num2str(acceptError1) ' AR2' num2str(acceptError2) ...
' I' num2str(sucesses) ' '];
[abcValuesSing, ~] = MCMCNottinghamPhageNoLEven(protocolFile, ...
dataFile, sucesses, reportWindow, acceptError1, compMode, false, ...
savePlot);
[abcValuesBoth, ~] = MCMCNottinghamPhageNoLEven(protocolFile, ...
dataFile, sucesses, reportWindow, acceptError2, compMode, true, ...
savePlot);
plotDoubleHistograms(log10(abcValuesSing), log10(abcValuesBoth), ...
paramNames, true, savePlot, plotTitle);
toc
end