当前位置:网站首页>GEE(三):计算两个波段间的相关系数与相应的p值
GEE(三):计算两个波段间的相关系数与相应的p值
2022-07-07 21:50:00 【BetterQ.】
GEE中内置了计算相关系数的函数,可以分析两个变量之间的相关性,比如要分析两个波段之间的相关性,主要用到ee.Reducer.pearsonsCorrelation()函数。
ee.Reducer.pearsonsCorrelation()
内容:创建一个双输入归约器,用于计算 Pearson 的积矩相关系数和相关性 = 0 的 2 边 p 值检验。
无输入值,返回为Reducer.
以分析MODIS数据中NDVI和EVI之间的相关性为例,这两个波段的相关性肯定会很高,这里只是做个示例,实现代码如下:
// 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');
计算相关系数的主要为var corr1=collection.select('NDVI','EVI') .reduce(ee.Reducer.pearsonsCorrelation());,输出包括相关系数和p值。
边栏推荐
- 知识点滴 - PCB制造工艺流程
- Unity local coordinates and world coordinates
- Microservice Remote debug, nocalhost + rainbond microservice Development second Bomb
- 数据库每日一题---第22天:最后一次登录
- LeetCode142. Circular linked list II [two pointers, two methods for judging links in the linked list and finding ring points]
- Understand the session, cookie and token at one time, and the interview questions are all finalized
- Debezium系列之:源码阅读之SnapshotReader
- Micro service remote debug, nocalhost + rainbow micro service development second bullet
- LeetCode206. Reverse linked list [double pointer and recursion]
- Yarn cannot view the historical task log of yarn after enabling ACL user authentication. Solution
猜你喜欢

The wonderful relationship between message queue and express cabinet

行测-图形推理-7-相异图形类

肠道里的微生物和皮肤上的一样吗?

Innovation today | five key elements for enterprises to promote innovation

Unity与WebGL的相爱相杀

Cascade-LSTM: A Tree-Structured Neural Classifier for Detecting Misinformation Cascades-KDD2020

聊聊 Dart 的空安全 (null safety) 特性

Line test - graphic reasoning -7- different graphic classes

Line test - graphic reasoning - 1 - Chinese character class

Line test - graphic reasoning - 3 - symmetric graphic class
随机推荐
De la famille debezium: SET ROLE statements supportant mysql8
Comparison of various development methods of applets - cross end? Low code? Native? Or cloud development?
LeetCode707. Design linked list
iNFTnews | Web5 vs Web3:未来是一个过程,而不是目的地
数字藏品加速出圈,MarsNFT助力多元化文旅经济!
Debezium series: source code reading snapshot reader
面试百问:如何测试App性能?
The author of LinkedList said he didn't use LinkedList himself
ASEMI整流桥KBPC1510的型号数字代表什么
Debezium系列之:引入对 LATERAL 运算符的支持
Debezium series: support the use of variables in the Kill Command
Line test - graphic reasoning - 4 - alphabetic class
One question per day - pat grade B 1002 questions
Use JfreeChart to generate curves, histograms, pie charts, and distribution charts and display them to JSP-1
7-18 simple simulation of banking business queue
行测-图形推理-2-黑白格类
Brush question 6
Database daily question --- day 22: last login
Locate to the bottom [easy to understand]
行测-图形推理-4-字母类