-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoClusterCorrelationExpansion.m
55 lines (39 loc) · 1.46 KB
/
doClusterCorrelationExpansion.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
function [Signals, AuxiliarySignals] = ...
doClusterCorrelationExpansion(...
Coherences, Clusters, SubclusterIndices, ...
timepoints,dimensionality, order,numberClusters)
% Coherences{n(iCluster,timepoints)
% SubclusterIndices{clusterSize} (jCluster,subCluster_size, iCluster) =
% the jth cluster of size subCluster_size that is a subcluster of
% the ith cluster of size clusterSize.
% In a valid cluster, all indices must be natural numbers.
% Initialize data.
AuxiliarySignals = Coherences;
Signals = ones(order,timepoints^dimensionality);
%--------------------------------------------------------------------------
% n-Clusters
%--------------------------------------------------------------------------
for isize = 1:order
for iCluster=1:numberClusters(isize)
% Remove m-cluster correlations
for jsize = 1:(isize-1)
for subcluster_index = SubclusterIndices{isize}(:,jsize,iCluster)'
if subcluster_index <= 0
continue;
end
AuxiliarySignals{isize}(iCluster,:) = ...
AuxiliarySignals{isize}(iCluster,:) ...
./AuxiliarySignals{jsize}(subcluster_index,:);
end
end
% Update cluster signals.
for iorder=isize:order
this_cluster = Clusters(iCluster,1:isize,isize);
if this_cluster(1)==0
continue;
end
Signals(iorder,:) = Signals(iorder,:).*AuxiliarySignals{isize}(iCluster,:);
end
end
end
end