how to perform lag correlation between two spatial data?

조회 수: 10 (최근 30일)
Vedanta
Vedanta 2024년 1월 23일
댓글: Vedanta 2024년 1월 23일
Hello everyone,
I have two spatial data sets for 5years, temperature and rainfall (180x360x60). here 180x360 is lat and lon and 60 is number of months.
I want to do the lag correlation analysis (at 0, 1, 2, 3 month) between these two data sets? the outputs will be same as the data format:
correlation coefficient = 180x360
pvalue = 180x360
I have done this analysis with vector data but I am stuck in this, can someone suggest me how this could be done?
thanks.
  댓글 수: 2
George Abrahams
George Abrahams 2024년 1월 23일
What type of correlation are you looking for? I'm going to assume the Pearson correlation coefficient, as you were satisfied with this in your previous question.
Vedanta
Vedanta 2024년 1월 23일
@George Abrahams yes, peason correlation

댓글을 달려면 로그인하십시오.

답변 (1개)

Taylor
Taylor 2024년 1월 23일
If you input two matrices, A and B, into corrcoef, corrcoef will convert them into their vector representation equivalent to corrcoef(A(:), B(:)) or corrcoef([A(:) B(:)]) (https://www.mathworks.com/help/matlab/ref/corrcoef.html#f80-999628-B). Thus, you will get a 2x2 matrix for the correlation coefficients and p-values (https://www.mathworks.com/help/matlab/ref/corrcoef.html#f80-999628-R). You will need to loop over each latitude/longitude and each month (e.g., corrcoef(A(:,ii,jj), A(:,ii,jj+1))) if you are trying to analyze correlation at the perlatitude/longitude level. Otherwise, corrcoef(A(:,:,jj), A(:,:,jj+1)) will yield the correlation coefficients for all latitudes and longitudes across time.

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by