how to perform lag correlation between two spatial data?

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 日

0 投票

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.

カテゴリ

ヘルプ センター および File ExchangeDescriptive Statistics についてさらに検索

質問済み:

2024 年 1 月 23 日

コメント済み:

2024 年 1 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by