当前位置:网站首页>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值。
边栏推荐
- 定位到最底部[通俗易懂]
- 2021-01-11
- 微服務遠程Debug,Nocalhost + Rainbond微服務開發第二彈
- 筑起云端 “免疫”屏障,让你的数据有备无患
- This time, let's clear up: synchronous, asynchronous, blocking, non blocking
- Digital transformation: five steps to promote enterprise progress
- LeetCode142. Circular linked list II [two pointers, two methods for judging links in the linked list and finding ring points]
- XMIND mind mapping software sharing
- Unity technical notes (I) inspector extension
- 一次搞明白 Session、Cookie、Token,面试问题全稿定
猜你喜欢
PCL . VTK files and Mutual conversion of PCD
LeetCode203. Remove linked list elements
Innovation today | five key elements for enterprises to promote innovation
There is another problem just online... Warm
It's no exaggeration to say that this is the most user-friendly basic tutorial of pytest I've ever seen
Microservice Remote debug, nocalhost + rainbond microservice Development second Bomb
不夸张地说,这是我见过最通俗易懂的,pytest入门基础教程
Transform XL translation
Redis cluster installation
数字化转型:五个步骤推动企业进步
随机推荐
Unity与WebGL的相爱相杀
每日一题——PAT乙级1002题
Unity and webgl love each other
“拧巴”的早教行业:万亿市场,难出巨头
0-5vac to 4-20mA AC current isolated transmitter / conversion module
一次搞明白 Session、Cookie、Token,面试问题全稿定
Line test - graphic reasoning -7- different graphic classes
Class implementation of linear stack and linear queue (another binary tree pointer version)
OC variable parameter transfer
Leetcode206. Reverse linked list
ASEMI整流桥KBPC1510的型号数字代表什么
Locate to the bottom [easy to understand]
Debezium series: binlogreader for source code reading
Mitsubishi PLC SLmP (MC) protocol
线上面试,该如何更好的表现自己?这样做,提高50%通过率~
Brush question 4
今日创见|企业促进创新的5大关键要素
Debezium series: set role statement supporting mysql8
DTC社群运营怎么做?
There is another problem just online... Warm