Home > data-utility > granger_causality > gcause_libs > FDR.m

FDR

PURPOSE ^

SYNOPSIS ^

function [GCMAP] = FDR(D,p,ht)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [GCMAP] = FDR(D,p,ht)
0002 
0003 [CHN,CHN] = size(D);
0004 
0005 % Number of multiple hypothesis tests
0006 m = CHN*CHN;
0007 
0008 % P-values
0009 for n = 1:CHN
0010      P(n,:) = 1 - chi2cdf(D(n,:),ht(n));
0011 end
0012 [Ps,idx] = sort(P(:));
0013 
0014 for k = 1:m
0015     if Ps(k) > k/m*p;
0016         break;
0017     end
0018 end
0019 k = k-1;
0020 
0021 GCMAP = zeros(size(D));
0022 
0023 for ii = 1:k
0024     if fix(idx(ii)/n) == idx(ii)/n
0025         GCMAP(n,idx(ii)/n) = 1;
0026     else
0027         GCMAP(idx(ii)-fix(idx(ii)/n)*n,fix(idx(ii)/n)+1) = 1;
0028     end
0029 end

Generated on Tue 23-May-2017 20:00:55 by m2html © 2005