当前位置:网站首页>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 .
边栏推荐
- 关于海康ipc的几个参数
- JS triangle
- 数字藏品加速出圈,MarsNFT助力多元化文旅经济!
- Cause analysis and solution of too laggy page of [test interview questions]
- Guessing game (read data from file)
- OC variable parameter transfer
- Introduction to anomaly detection
- Use JfreeChart to generate curves, histograms, pie charts, and distribution charts and display them to JSP-1
- 2022 words for yourself
- ./ setup. Insufficient sh permission
猜你喜欢

Two minutes, talk about some wrong understandings of MySQL index

What does the model number of asemi rectifier bridge kbpc1510 represent

Anta DTC | Anta transformation, building a growth flywheel that is not only FILA

Lecture 30 linear algebra Lecture 5 eigenvalues and eigenvectors

行测-图形推理-1-汉字类

微信论坛交流小程序系统毕业设计毕设(7)中期检查报告

数字藏品加速出圈,MarsNFT助力多元化文旅经济!

微信论坛交流小程序系统毕业设计毕设(1)开发概要

消费品企业敏捷创新转型案例

Brush question 4
随机推荐
Line test - graphic reasoning -5- one stroke class
消费品企业敏捷创新转型案例
Online interview, how to better express yourself? In this way, the passing rate will be increased by 50%~
Locate to the bottom [easy to understand]
聊聊 Dart 的空安全 (null safety) 特性
Circumvention Technology: Registry
【刷题记录】3. 无重复字符的最长子串
CTF exercise
二叉树(Binary Tree)
Years of summary, some core suggestions for learning programming
Clean C disk
安踏DTC | 安踏转型,构建不只有FILA的增长飞轮
Network security - install CentOS
微信论坛交流小程序系统毕业设计毕设(2)小程序功能
Network security - phishing
Sword finger offer 28 Symmetric binary tree
Transform XL translation
Microbial health network, how to restore microbial communities
数据库每日一题---第22天:最后一次登录
行测-图形推理-1-汉字类