Neural Network Toolbox | Search  Help Desk |
prepca | Examples See Also |
[ptrans,transMat] = prepca(P,min_frac)
prepca preprocesses the network input training set by applying a principal component analysis. This analysis transforms the input data so that the elements of the input vector set will be uncorrelated. In addition, the size of the input vectors may be reduced by retaining only those components which contribute more than a specified fraction (min_frac
) of the total variation in the data set.
prepca(p,min_frac)
takes these inputs
P - R
x Q
matrix of centered input (column) vectors.
min_frac -
Minimum fraction variance component to keep.
p=[-1.5 -0.58 0.21 -0.96 -0.79; -2.2 -0.87 0.31 -1.4 -1.2]; [pn,meanp,stdp] = prestd(p); [ptrans,transMat] = prepca(pn,0.02);Since the second row of
p
is almost a multiple of the first row, this example will produce a transformed data set which contains only one row.
This routine uses singular value decomposition to compute the principal components. The input vectors are multiplied by a matrix whose rows consist of the eigenvectors of the input covariance matrix. This produces transformed input vectors whose components are uncorrelated and ordered according to the magnitude of their variance.
Those components which contribute only a small amount to the total variance in the data set are eliminated. It is assumed that the input data set has already been normalized so that it has a zero mean. The function prestd can be used to normalize the data.
prestd
,
premnmx
Jolliffe, I.T.,Principal Component Analysis, New York: Springer-Verlag, 1986.