资源预览内容
第1页 / 共7页
第2页 / 共7页
第3页 / 共7页
第4页 / 共7页
第5页 / 共7页
第6页 / 共7页
第7页 / 共7页
亲,该文档总共7页全部预览完了,如果喜欢就下载吧!
资源描述
相关系数计算公式相关系数计算公式Statistical correlation coefficientDue to the statistical correlation coefficient used more frequently, so here is the use of a few articles introduce these coefficients.The correlation coefficient: a study of two things (in the data we call the degree of correlation between the variables).If there are two variables: X, Y, correlation coefficient obtained by the meaning can be understood as follows:(1) , when the correlation coefficient is 0, X and Y two variable relationship.(2) , when the value of X increases (decreases), Y value increases (decreases), the two variables are positive correlation, correlation coefficient between 0 and 1.(3) , when the value of X increases (decreases), the value of Y decreases (increases), two variables are negatively correlated, the correlation coefficient between -1.00 and 0.The absolute value of the correlation coefficient is bigger, stronger correlations, the correlation coefficient is close to 1 or -1, the higher degree of correlation, the correlation coefficient is close to 0 and the correlation is weak.The related strength normally through the following range of judgment variables:The correlation coefficient 0.8-1.0 strong correlation0.6-0.8 strong correlation0.4-0.6 medium degree.0.2-0.4 weak correlation 0.0-0.2 very weakly correlated or not correlatedPearson (Pearson) correlation coefficient1, introductionPearson is also known as the correlation (or correlation) is a kind of calculation method of the linear correlation of British statistician Pearson in twentieth Century.Suppose there are two variables X, Y, then the Pearson correlation coefficient between the two variables can be calculated by the following formula:A formula:Formula two:Formula three:Formula four:Four equivalent formulas listed above, where E is the mathematical expectation, cov said the covariance, N represents the number of variables.2, scope of applicationWhen the two variables of the standard deviation is not zero, the correlation coefficient is defined, the correlation coefficient for Pearson:(1) , is the linear relationship between the two variables, are continuous data.(2) overall, two variables are normally distributed, or near normal unimodal distribution.(3) and the observation values of two variables is in pairs, each pair of observations are independent of each other.3, MatlabPearson correlation coefficient Matlab (according to the formula four):cpp view plaincopyFunction coeff = myPearson (X, Y)% of the function of the realization of the Pearson correlation coefficient calculating operation% input:% X: numerical sequence input% Y: numerical sequence input% output:% coeff: two input numerical sequence X, the correlation coefficient of Y%If length (X) = length (Y)Error (two numerical sequence dimension is not equal to);Return;EndFenzi = sum (X * Y) - (sum (X) * sum (Y) / length (X);(fenmu = sqrt (sum (X.a2) - sum (X) a2 / le ngth (X) * (sum (Y.a2) - sum (Y) a2 / le ngth (X);Coeff = fenzi / fenmu;End% myPearson end functionCalculate the Pearson correlation coefficient function can also be used in existing Matlab:cpp view plaincopyCoeff = corr (X, Y);4, reference contentSpearman Rank (Spielman rank correlation coefficient)1, introductionIn statistics, Spielman correlation coefficient is named for Charles Spearman, and often use the Greek symbol (rho) said its value. Spielman rank correlation coefficient is used to estimate the correlation between the two variables X and Y, the correlation between variables can be used to describe the monotone function.If the two sets of two variable does not have the same two elements, so, when one of the variables can be expressed as a monotone function well when another variable (i.e. changes in two variables of the same trend), between the two variables can reach +1 or -1.Suppose that two random variables were X, Y (also can be seen as a set of two), the number of their elements are N, two I(1=i=N) random variables take values respectively with Xi, Yi said. Sort of X, Y (at the same time as ascending or descending), two ranking elements set X, y, Xi, Yi elements which are Xi in X and Yi ranking in the Y ranking. The collection of X, y elements in the corresponding subtraction to get a list of difference set D, di=xi-yi, 1=i=N. Spielman rank correlation coefficient between random variables X and Y can be obtained by X, y or D calculation, the calculation methods are as follows:By ranking difference calculated from D diversity (formula one):From the top set X, calculated from Y (Spielman rank correlation coefficient were also considered after ranking two random variables Pearson correlation coefficient, the following is the actual Pearson calculated the correlation coefficient X, y) (formula two):The following is a set of elements in the list of examples of calculation (calculated only for Spielman r
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号