nancov gives strange results
이전 댓글 표시
I have a standardized matrix (aod_normalized) of a variable whose size is 3653*12, where 3653 is the no. of observations and 12 represents the no. of stations. There are many NaN's in the dataset(10-50% in different stations). Standard deviation of this matrix as calculated using nanstd is 1 for all the stations.
I calculated the covariance matrix of the data using: cov_matrix = nancov(aod_normalized)
I expected that the diagonal elements of the cov_matrix (of size 12*12) would all be equal to 1. However, the results show that all the diagonal elements are greater than 1. This looks little strange to me. I tried the same procedure with another dataset that does not contain any NaNs, in which case, the diagonal elements are all equal to 1 as expected. Could someone explain why I am getting this result?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!