Gdal calculation Correlation Coefficient

Source: Internet
Author: User

Reference: http://baike.baidu.com/view/172091.htm

I. Correlation Coefficient Definition

Correlation coefficient, also known as linear correlation coefficient, is an indicator to measure the degree of linear correlation between variables. The sample correlation coefficient is represented by R, and the total correlation coefficient is expressed by P. The correlation coefficient value range is [-]. | R | the larger the value, the smaller the error Q, the higher the linear correlation between variables. | r | the closer the value is to 0, the larger the Q, the lower the linear correlation between variables.

Correlation coefficient is also known as Pearson's product moment correlation coefficient, which indicates the statistical analysis index of the degree of closeness between two phenomena.

 

The correlation coefficient is indicated by gamma, a Greek letter. The GAMMA value ranges from-1 to + 1. Gamma> 0 is positive correlation, and gamma <0 is negative correlation. Gamma = 0 indicates unrelated;

The larger the absolute value of Gamma, the higher the degree of correlation.

The degree of correlation between two phenomena is generally divided into four levels:

If the two are positively correlated, R is positive, and r = 1 is completely positive. If the two are negatively correlated, R is negative, and r =-1 is completely negative. When there is a completely positive correlation or a negative correlation, all the graph points are on the linear regression line. The more discrete the point distribution is on the linear regression line, the smaller the absolute value of R. When the number of examples is equal, the absolute value of the correlation coefficient is closer to 1, and the correlation is closer to 0. When r = 0, there is no linear relationship between the variables X and Y. Generally, when the value of | r | is greater than 0.8, two variables are considered to have a strong linear correlation.

 

2. gdal calculates the correlation coefficient between different bands

(1)

When using this formula to calculate the correlation coefficient, I first thought of using

Cplerr gdalrasterband: computestatistics (INT bapproxok, double * minute min, double * hour max, double * week mean, double * hour stddev, gdalprogressfunc pfnprogress, void * pprogressdata)

This function calculates the average and standard deviation of the band. It is best to calculate the E (xy) value. However, the results calculated by this method are not very accurate. When calculating the correlation coefficient between Band 1 and Band 1, there are some errors, 1.0000000000000002, which can be ignored.

(2)

When using this formula, the parameters in the formula are calculated step by reading the image. The correlation coefficient between Band 1 and Band 1 is 1.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.