significant correlation values

조회 수: 1 (최근 30일)
Richard
Richard 2012년 4월 25일
How is it possible to test whether the correlation between 2 time series is significant?
For example:
clear all
a = 1;
b = 20;
Fieldnames = {'data1','data2','data3','data4'};
data1 = a + (b-a).*rand(100,1);
data2 = a + (b-a).*rand(100,1);
data3 = a + (b-a).*rand(100,1);
data4 = a + (b-a).*rand(100,1);
NewData = [data1,data2,data3,data4];
R = nonzeros(tril(corrcoef(NewData),-1));
R_values = [Fieldnames(nchoosek(1:length(Fieldnames),2)) num2cell(R)];
How would I find if the correlation values were significant?

답변 (1개)

Wayne King
Wayne King 2012년 4월 25일
You can return the p-values from corrcoef
a = 0;
b = 1;
data1 = a + (b-a).*rand(100,1);
data2 = a + (b-a).*rand(100,1);
data3 = a + (b-a).*rand(100,1);
data4 = a + (b-a).*rand(100,1);
NewData = [data1,data2,data3,data4];
[r,p] = corrcoef(NewData);
% row and column indices of significant correlations
[I,J] = find(p<0.05);
Of course this is not giving the correlation for anything but at zero lag. Often in time series analysis you assume that there may be correlation between two time series if one is lagged with respect to the other.

카테고리

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