私は、2つの信号(XA、YA)及び(XB、YB)の混合物であるスペクトル(吸収(Y)対波長(X))を有しています。私は(x、y)の中の信号をunmixするPCA(私はオンラインで見つけるコード)を使用しようとしています:Matlabの:信号に対して主成分分析(スペクトルアンミキシング)
%step 1, input data
numdata=length(data(:,1));
x=data(:,1);
y=data(:,1);
%step 2, finding a mean and subtracting
xmean=mean(x);
ymean=mean(y);
xnew=x-xmean*ones(numdata,1);
ynew=y-ymean*ones(numdata,1);
subplot(3,1,1);
plot(x,y, 'o');
title('Original Data');
%step 3, covariance matrix
covariancematrix=cov(xnew,ynew);
%step 4, Finding Eigenvectors
[V,D] = eig(covariancematrix);
D=diag(D);
maxeigval=V(:,find(D==max(D)));
%step 5, Deriving the new data set
%finding the projection onto the eigenvectors
finaldata=maxeigval'*[xnew,ynew]';
subplot(3,1,2);
stem(finaldata, 'DisplayName', 'finaldata', 'YDataSource', 'finaldata');
title('PCA 1D output ')
%we do a classification now
subplot(3,1,3);
title('Final Classification')
hold on
for i=1:size(finaldata,2)
if finaldata(i)>=0
plot(x(i),y(i),'o')
plot(x(i),y(i),'r*')
else
plot(x(i),y(i),'o')
plot(x(i),y(i),'g*')
end
end
部品屋とYBに(y)をunmixするPCA出力を適用するために最善の方法?私はPCAの経験がなく、このアプリケーションのオンラインチュートリアルを見つけることができません。トレーニングスペクトル用の固有ベクトルを生成し、次にテストスペクトルと比較するのが最良ですか?この論文のおかげ
どのようなアプリケーションで使用していますか?行列の各要素(POSX、POSY、スペクトル)について – m7913d
は、YAと上記YBスペクトルと最も可能性の高いスペクトル(すなわち、YA又はYBのいずれか)からの寄与を決定しました – 2one