当前位置:网站首页>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 .
边栏推荐
- 知识点滴 - PCB制造工艺流程
- 双非大厂测试员亲述:对测试员来说,学历重要吗?
- [untitled] reprint melting ice - track icedid server with a few simple steps
- 网格(Grid)
- 网络安全-burpsuit
- 小程序多种开发方式对比-跨端?低代码?原生?还是云开发?
- 智慧社區和智慧城市之間有什麼异同
- Brush question 3
- Personal statement of testers from Shuangfei large factory: is education important for testers?
- 二叉树(Binary Tree)
猜你喜欢
随机推荐
知识点滴 - PCB制造工艺流程
2021-01-12
Adrnoid开发系列(二十五):使用AlertDialog创建各种类型的对话框
It's no exaggeration to say that this is the most user-friendly basic tutorial of pytest I've ever seen
2022 words for yourself
Sword finger offer 63 Maximum profit of stock
Introduction to redis and jedis and redis things
iNFTnews | Web5 vs Web3:未来是一个过程,而不是目的地
Why does the market need low code?
Network security - phishing
This time, let's clear up: synchronous, asynchronous, blocking, non blocking
V20变频器手自动切换(就地远程切换)的具体方法示例
开发那些事儿:Go加C.free释放内存,编译报错是什么原因?
Innovation today | five key elements for enterprises to promote innovation
关于海康ipc的几个参数
网络安全-beef
微信论坛交流小程序系统毕业设计毕设(4)开题报告
Byte hexadecimal binary understanding
Years of summary, some core suggestions for learning programming
What is ADC sampling rate (Hz) and how to calculate it