how to perform lag correlation between two spatial data?
조회 수: 10 (최근 30일)
이전 댓글 표시
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
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.
답변 (1개)
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.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!