当前位置:网站首页>Gee (III): calculate the correlation coefficient between two bands and the corresponding p value
Gee (III): calculate the correlation coefficient between two bands and the corresponding p value
2022-07-07 23:12:00 【BetterQ.】
GEE A function for calculating the correlation coefficient is built in , You can analyze the correlation between two variables , For example, we need to analyze the correlation between the two bands , Mainly used ee.Reducer.pearsonsCorrelation()
function .
ee.Reducer.pearsonsCorrelation()
Content : Create a dual input reducer , Used to calculate Pearson Product moment correlation coefficient and Correlation = 0 Of 2 edge p Value test .
No input value , Return to Reducer.
To analyze MODIS In the data NDVI and EVI Take the correlation between as an example , The correlation between these two bands will certainly be very high , Here's just an example , The implementation code is as follows :
// This function adds a band representing the image timestamp.
var addTime = function(image) {
return image.addBands(image.metadata('system:time_start')
// Convert milliseconds from epoch to years to aid in
// interpretation of the following trend calculation.
.divide(1000 * 60 * 60 * 24 * 365));
};
// Load a MODIS collection, filter to several years of 16 day mosaics,
// and map the time band function over it.
var collection = ee.ImageCollection('MODIS/006/MYD13A1')
.filterDate('2004-01-01', '2010-10-31')
.map(addTime);
//correlation between evi and ndvi
var corr1=collection.select('NDVI','EVI')
.reduce(ee.Reducer.pearsonsCorrelation());
Map.addLayer(
corr1,
{
min: 0, max: 1, bands: ['correlation', 'p-value']},
'EVI_NDVI correlation');
The main method to calculate the correlation coefficient is var corr1=collection.select('NDVI','EVI') .reduce(ee.Reducer.pearsonsCorrelation());
, The output includes correlation coefficient and p value .
边栏推荐
猜你喜欢
iNFTnews | NFT技术的广泛应用及其存在的问题
Are the microorganisms in the intestines the same as those on the skin?
Unity and webgl love each other
Line test - graphic reasoning - 1 - Chinese character class
Binary tree
PCL . VTK files and Mutual conversion of PCD
30讲 线性代数 第五讲 特征值与特征向量
Transform XL translation
一次搞明白 Session、Cookie、Token,面试问题全稿定
The wonderful relationship between message queue and express cabinet
随机推荐
Exploratory data analysis of heartbeat signal
Digital collections accelerated out of the circle, and marsnft helped diversify the culture and tourism economy!
Interview questions: how to test app performance?
V20变频器手自动切换(就地远程切换)的具体方法示例
Byte hexadecimal binary understanding
Cascade-LSTM: A Tree-Structured Neural Classifier for Detecting Misinformation Cascades-KDD2020
微信论坛交流小程序系统毕业设计毕设(6)开题答辩PPT
Understand the session, cookie and token at one time, and the interview questions are all finalized
Cause analysis and solution of too laggy page of [test interview questions]
Bit operation
ArcGIS:字段赋值_属性表字段计算器(Field Calculator)依据条件为字段赋值
Why does the market need low code?
Years of summary, some core suggestions for learning programming
智慧社区和智慧城市之间有什么异同
iNFTnews | Web5 vs Web3:未来是一个过程,而不是目的地
二叉树(Binary Tree)
Lecture 30 linear algebra Lecture 5 eigenvalues and eigenvectors
Advantages and disadvantages of rest ful API
Innovation today | five key elements for enterprises to promote innovation
Talk about DART's null safety feature