⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 get_degree.m

📁 度是网络中的一个重要概念
💻 M
字号:
function Degree=get_degree(Nodes)
%r=(<ab>-<a><b>)/squr( (<a^2>-<a>^2)(<b^2>-<b>^2) ) 
% =( sum(ab)-sum(a)sum(b)/N )/sqrt( ( (sum(a^2)-sum(a)^2/N )(sum(b^2)-sum(b)^2/N ) )
%see Ref[PRE70,046126,2004]
%
%Properties of Pearson's Correlation
%http://www.stat.tamu.edu/stat30x/notes/node40.html
%1.The value of r does not depend upon the units of measurement. For example, 
%if X is the weight in pounds and Y is the height in inches of a person, 
%then the correlation between X and Y would be the same if we measured X in kilograms and Y in centimeters.
%2.The value of r does not depend upon which variable is labeled X and which variable is labeled Y.
%3.1-<=r<=1.A positive value of r means a positive linear relationship, a negative value of r means a negative linear relationship.
%4.r=1 or -1 happens only when all the points of the scatter plot lie exactly on a straight line.
%5.r measures only the linear relationship between X and Y. 
%Usually we will refer to Pearson's correlation simply by saying ``the correlation between X and Y is  '' 
%
N=length(Nodes);
Degree=zeros(N,1);

for i=1:N
    Nodes(i,i)=0;
    Degree(i)=nnz(Nodes(i,:));
end

return

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -