-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontrol.m
115 lines (90 loc) · 2.34 KB
/
control.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
% |----------------------------------------------------------------------------
% |The control.m script defines all essential variables (default values) if not
% |already done by the user via the setting.m script, and checks whether
% |definitions made by the user (setting.m) are erroneous.
% |For more details, consult the reBoot manual available at
% |<http://www.reiher.ethz.ch/software/reboot/manual.pdf>.
% |----------------------------------------------------------------------------
if ~exist('inputOpt');
inputOpt = struct();
end
if ~isfield(inputOpt,'multipleInputs')
inputOpt.multipleInputs = 0;
end
if ~isfield(inputOpt,'expUncertainty')
inputOpt.expUncertainty = 0;
end
if inputOpt.expUncertainty && ~isfield(inputOpt,'allowOnlyEU')
inputOpt.allowOnlyEU = 0;
end
if ~isfield(inputOpt,'critical')
inputOpt.critical = 0;
end
if inputOpt.critical && ~exist('critical.txt')
error("file 'critical.txt' does not exist");
end
if ~isfield(inputOpt,'randomData')
inputOpt.randomData = 0;
end
if inputOpt.randomData && ~exist('N')
N = 100;
elseif inputOpt.randomData && (length(N) ~= 1)
error("number of data points ('N') must be a scalar");
elseif inputOpt.randomData && ((N < 0) || mod(N,1))
error("number of data points ('N') must be a non-negative integer");
end
if ~inputOpt.randomData && ~exist('data.txt')
error("file 'data.txt' does not exist");
end
if ~exist('M')
M = 1;
end
if ~exist('inputID')
inputID = 1;
elseif length(inputID) ~= 1
error("'inputID' must be a scalar");
elseif (inputID < 0) || mod(inputID,1)
error("'inputID' must be a non-negative integer");
end
if ~exist('B')
B = 1000;
end
if ~exist('blrMode')
blrMode = 2;
end
if ~exist('lsrType')
lsrType = @OLS;
end
if ~exist('calOpt');
calOpt = struct();
end
if ~isfield(calOpt,'xScale')
calOpt.xScale = 1;
end
if ~isfield(calOpt,'resolution')
calOpt.resolution = [];
end
if ~isfield(calOpt,'increase')
calOpt.increase = 0;
end
if ~isfield(calOpt,'bootDetail')
calOpt.bootDetail = 1;
end
if ~isfield(calOpt,'bayesConv')
calOpt.bayesConv = 1e-3;
end
if ~isfield(calOpt,'bayesMaxIter')
calOpt.bayesMaxIter = 100;
end
if ~isfield(calOpt,'irlsConv')
calOpt.irlsConv = 1e-3;
end
if ~isfield(calOpt,'irlsMaxIter')
calOpt.irlsMaxIter = 100;
end
if ~isfield(calOpt,'reglsPenalty')
calOpt.reglsPenalty = 1e-3;
end
if ~exist('calPlot')
calPlot = 0;
end