participateCoef

PURPOSE ^

PARTICIPATECOEF compute modified participate coefficient of network

SYNOPSIS ^

function [ parCoef ] = participateCoef( network )

DESCRIPTION ^

 PARTICIPATECOEF compute modified participate coefficient of network

   [ parCoef ] = participateCoef( network )
   This function compute modified participate coefficient (normalize output of
   the coefficient to [0, 1]) of each nodes in network.

   Input:
       network: input network which has been sorted by module (sortByModule())

   Output:
       parCoef: participate coefficient of nodes in input network

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [ parCoef ] = participateCoef( network )
0002 % PARTICIPATECOEF compute modified participate coefficient of network
0003 %
0004 %   [ parCoef ] = participateCoef( network )
0005 %   This function compute modified participate coefficient (normalize output of
0006 %   the coefficient to [0, 1]) of each nodes in network.
0007 %
0008 %   Input:
0009 %       network: input network which has been sorted by module (sortByModule())
0010 %
0011 %   Output:
0012 %       parCoef: participate coefficient of nodes in input network
0013 
0014 %   ---------
0015 %   Yen-Nan Lin, NTHU, 2010-2014, Matlab 2012a
0016 
0017 moduleList = unique(network.moduleId);
0018 nModule = numel(moduleList);
0019 nNode = network.size;
0020 parCoef = zeros(1, nNode);
0021 tmpMat = network.matrix;
0022 for iNode = 1:nNode
0023     tmpCoef = [];
0024     tmpSumDeg = numel(find(tmpMat(:, iNode))) + numel(find(tmpMat(iNode, :)));
0025     for jModule = moduleList
0026         tmpModuleIx = find(network.moduleId == jModule);
0027         tmpModuleLink = numel(find(tmpMat(tmpModuleIx, iNode))) + ...
0028             numel(find(tmpMat(iNode, tmpModuleIx)));
0029         tmpCoef(jModule) = (tmpModuleLink / tmpSumDeg) ^ 2;
0030     end
0031 
0032     % normalize participate coefficient to [0, 1]
0033     parCoef(iNode) = (1 - sum(tmpCoef)) * (nModule / (nModule - 1));
0034 end
0035 end

Generated on Thu 30-Jan-2014 00:00:07 by m2html © 2005