필터 지우기
필터 지우기

散布図の相関係数の求め方

조회 수: 25 (최근 30일)
Naoki Ishibashi
Naoki Ishibashi 2016년 10월 9일
답변: michio 2016년 10월 10일
以下のプログラムで書いた散布図の相互相関係数を求めたいのですが、プロットした各データセットの係数ではなく、重ね合わせた全てのデータの相関係数を求めたいのですがなにかいい方法ありましたら教えて頂けると幸いです。
for i = 1:12
hold on
if i==1 || i==3 || i==5 || i==7 || i==8 || i==10 || i==12
for j = 1:31
xfilename = sprintf('TA2004%02d%02d.txt',i,j);
yfilename = sprintf('TS2004%02d%02d.txt',i,j);
x = load(xfilename);
y = load(yfilename);
if i==1 && j == 1
scatter(x,y);
else
scatter(x,y);
end
end
elseif i==2
for j = 1:29
xfilename = sprintf('TA2004%02d%02d.txt',i,j);
yfilename = sprintf('TS2004%02d%02d.txt',i,j);
x = load(xfilename);
y = load(yfilename);
scatter(x,y);
end
else
for j = 1:30
xfilename = sprintf('TA2004%02d%02d.txt',i,j);
yfilename = sprintf('TS2004%02d%02d.txt',i,j);
x = load(xfilename);
y = load(yfilename);
scatter(x,y);
end
end
hold off
end
xlabel('surface temperature');
ylabel('near-surface air temperature');
  댓글 수: 2
Walter Roberson
Walter Roberson 2016년 10월 9일
Approximate translation:
The following I'd like to seek a cross-correlation coefficient of the scatter plot written in the program, rather than the coefficient of each data set that you plot, there is a method But something good to want to find the correlation coefficients of all of the data superimposed or I hope to teach who can do.
Walter Roberson
Walter Roberson 2016년 10월 9일
This appears to be the same program as in your previous question http://www.mathworks.com/matlabcentral/answers/306509- . I suggest you combine the questions.

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

답변 (1개)

michio
michio 2016년 10월 10일
corrcoef関数で相関係数は計算できるかと思います。
「各データセットごとではなくプロットした全ての値」から相関係数または線形回帰などの処理をされたいとのこと。 http://jp.mathworks.com/matlabcentral/answers/306509- への回答でも触れていますが、処理の対象となるデータがメモリ上に収まるのであれば、すべてを1つの変数に保持できれば様々な処理が簡単になります。データの読み込み方法についてご検討ください。

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by