散布図の相関係数の求め方
조회 수: 94 (최근 30일)
이전 댓글 표시
以下のプログラムで書いた散布図の相互相関係数を求めたいのですが、プロットした各データセットの係数ではなく、重ね合わせた全てのデータの相関係数を求めたいのですがなにかいい方法ありましたら教えて頂けると幸いです。
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
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
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
2016년 10월 10일
corrcoef関数で相関係数は計算できるかと思います。
「各データセットごとではなくプロットした全ての値」から相関係数または線形回帰などの処理をされたいとのこと。 http://jp.mathworks.com/matlabcentral/answers/306509- への回答でも触れていますが、処理の対象となるデータがメモリ上に収まるのであれば、すべてを1つの変数に保持できれば様々な処理が簡単になります。データの読み込み方法についてご検討ください。
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!