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

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 Center および File ExchangeMultirate Signal Processing についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by