-
Notifications
You must be signed in to change notification settings - Fork 0
/
coh_constraints_vertrays.m
54 lines (45 loc) · 1.74 KB
/
coh_constraints_vertrays.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
function constraints = coh_constraints_vertrays(K)
% COH_CONSTRAINTS_VERTRAYS returns coherence constraints
%
% Synopsis:
% coh_constraints_vertrays(K)
%
% Input:
% K = a nonnegative matrix with nonconstant columns ("gambles")
%
% Output:
% constraints = a struct describing constraints P'λ <= α with three
% fields:
% * A, a matrix containing the constraint coefficients λ
% as rows
% * B, a column vector containing the corresponding
% constraint constants α as components
% * lin, a column vector with indices of constraints
% that are actually equalities (== instead of <=)
%
% Background & Method:
% To be coherent, a lower prevision defined on a set of gambles K must
% for all matrices S that differ from the identity matrix by at most one
% signchange be S-dominated by a linear prevision, i.e., a convex
% combination of degenerate previsions; these correspond to the rows
% of K. Here, S . This means that it belongs to the polyhedron defined
% by the degenerate previsions as vertices and the columns of -S as
% extreme rays.
%
% See also CDDMEX, ASL_CONSTRAINTS_VERTRAYS
[n, m] = size(K);
% preallocate
ABS = cell(1, m + 1);
HI = cddmex('hull', struct('V', K, 'R', -eye(m)));
ABS{m+1} = [HI.A, HI.B; -HI.A(HI.lin), -HI.B(HI.lin)];
for k = 1:m
% create S-matrix:
S = eye(m);
S(k,k) = -1;
HS = cddmex('hull', struct('V', K, 'R', -S));
ABS{k} = [HS.A, HS.B; -HS.A(HS.lin), -HS.B(HS.lin)];
end
AB = unique(vertcat(ABS{1:end}), 'rows');
constraints = cddmex('reduce_h', ...
struct('A', AB(:,1:end-1), 'B', AB(:,end)));
end