forked from robince/partial-info-decomp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
monopid_from_ped.m
34 lines (27 loc) · 872 Bytes
/
monopid_from_ped.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
function pid = pid_from_ped(lat)
% calculate full PID (including ambiguous terms) from a PED
if lat.Nx ~= 3
error('only 2 variable PID supported')
end
pid = zeros(1,4);
n = lat.nodes;
% redundancy
pid(1) = lat.PI(n('{1}{2}{3}')) ...
- lat.PI(n('{13}{23}')); ...
% - lat.PI(n('{12}{13}{23}'));
% unique info
pid(2) = lat.PI(n('{1}{3}')) ...
- lat.PI(n('{13}')); ...
% - lat.PI(n('{12}{13}')) ...
% - lat.PI(n('{2}{13}'));
pid(3) = lat.PI(n('{2}{3}')) ...
- lat.PI(n('{23}')); ...
% - lat.PI(n('{12}{23}')) ...
% - lat.PI(n('{1}{23}'));
% synergy
pid(4) = lat.PI(n('{3}{12}')) - lat.PI(n('{123}'));
% + lat.PI(n('{12}{13}')) ...
% + lat.PI(n('{12}{23}')) ...
% + lat.PI(n('{12}{13}{23}')) ...
% + lat.PI(n('{1}{23}')) ...
% + lat.PI(n('{2}{13}')) ...