相关系数计算公式
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
相关系数计算公式
相关系数计算公式
Statistical correlation coefficient
Due 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 correlation
0.6-0.8 strong correlation
0.4-0.6 medium degree.
0.2-0.4 weak correlation
0.0-0.2 very weakly correlated or not correlated
Pearson (Pearson) correlation coefficient
1, introduction
Pearson 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 application
When 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, Matlab
Pearson correlation coefficient Matlab (according to the formula four):
[cpp] view plaincopy
Function 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;