processpca
主成分分析による行列の列の処理
構文
[Y,PS] = processpca(X,maxfrac)
[Y,PS] = processpca(X,FP)
Y = processpca('apply',X,PS)
X = processpca('reverse',Y,PS)
name = processpca('name')
fp = processpca('pdefaults')
names = processpca('pdesc')
processpca('pcheck',fp);
説明
processpca
は、主成分分析を使用して行列を処理します。この処理によって、各行が無相関となり、全変動への寄与量の順に行が並べられ、全変動への寄与が maxfrac
未満である行が削除されます。
[Y,PS] = processpca(X,maxfrac)
は、X
およびオプションのパラメーターを取ります。
X |
|
maxfrac | 削除する行についての分散の最大比率 (既定は 0) |
これは、以下を返します。
Y |
|
PS | 値の一貫した処理を可能にする処理設定 |
[Y,PS] = processpca(X,FP)
は、struct としてパラメーター FP.maxfrac
を取ります。
Y = processpca('apply',X,PS)
は、X
と設定 PS
を指定すると、Y
を返します。
X = processpca('reverse',Y,PS)
は、Y
と設定 PS
を指定すると、X
を返します。
name = processpca('name')
は、この処理手法の名前を返します。
fp = processpca('pdefaults')
は、既定の処理パラメーター構造体を返します。
names = processpca('pdesc')
は、処理パラメーターの説明を返します。
processpca('pcheck',fp);
は、無効なパラメーターがある場合にエラーをスローします。
例
ここでは、独立した行、相関のある行、および完全に冗長な行をもつ行列を再構成し、行の相関と冗長性を排除する方法を示します。
x1_independent = rand(1,5) x1_correlated = rand(1,5) + x1_independent; x1_redundant = x1_independent + x1_correlated x1 = [x1_independent; x1_correlated; x1_redundant] [y1,ps] = processpca(x1)
次に、新しい値に同じ処理設定を適用します。
x2_independent = rand(1,5) x2_correlated = rand(1,5) + x1_independent; x2_redundant = x1_independent + x1_correlated x2 = [x2_independent; x2_correlated; x2_redundant]; y2 = processpca('apply',x2,ps)
y1
の処理を逆にして、x1
を再取得します。
x1_again = processpca('reverse',y1,ps)
詳細
アルゴリズム
要素の値がすべて同じではない行の値は、次のように設定されます。
y = 2*(x-minx)/(maxx-minx) - 1;
値がすべて同じ行の値は 0 に設定されます。
バージョン履歴
R2006a で導入