-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaptValidation.m
More file actions
33 lines (26 loc) · 900 Bytes
/
Copy pathaptValidation.m
File metadata and controls
33 lines (26 loc) · 900 Bytes
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
function aptValidation
%APTVALIDATION estimates new candidates (which are generated by
%aptGenerateSequence) for given stats model.
% 'apt.vali.number' is number of newly generated candidates
% 'apt.vali.mode' is mode used for randomly generating new candidates.
global apt
if (~isfield(apt,'vali') || ~isfield(apt.vali,'number'))
apt.vali.number = 1000;
end
if ~isfield(apt.vali,'mode')
apt.vali.mode = 'best_seq';
end
aptGenerateValiSequence;
aptPredictors(true);
if ~all(size(apt.vali.truePredNames)==size(apt.predNames))
warning('Something went wrong!')
end
for iY = 1:length(apt.Y)
if isfield(apt.config,'useLassoFit') && strcmp(apt.config.useLassoFit,'best')
idx = apt.stats(iY).IndexMinMSE;
else
idx = apt.stats(iY).Index1SE;
end
apt.vali.estResponse{iY} = apt.stats(iY).Intercept(idx) + apt.vali.predX'*apt.stats(iY).beta(:,idx);
end
end