| Neural Network Toolbox | |
| Provide feedback about this page |
Process columns of matrix with principal component analysis
Syntax
[y,ps] = processpca(maxfrac) [y,ps] = processpca(x,fp) y = processpca('apply',x,ps) x = processpca('reverse',y,ps) dx_dy = processpca('dx',x,y,ps) dx_dy = processpca('dx',x,[],ps) name = processpca('name'); fp = processpca('pdefaults'); names = processpca('pnames'); processpca('pcheck',fp);
Description
processpca processes matrices using principal component analysis so that each row is uncorrelated, the rows are in the order of the amount they contribute to total variation, and rows whose contribution to total variation are less than maxfrac are removed.
processpca(X,maxfrac) takes X and an optional parameter,
X |
N x Q matrix or a 1 x TS row cell array of N x Q matrices |
maxfrac |
Maximum fraction of variance for removed rows (default is 0) |
Y |
Each N x Q matrix with N - M rows deleted (optional) |
PS |
Process settings that allow consistent processing of values |
processpca(X,FP) takes parameters as a struct: FP.maxfrac.
processpca('apply',X,PS) returns Y, given X and settings PS.
processpca('reverse',Y,PS) returns X, given Y and settings PS.
processpca('dx',X,Y,PS) returns the M x N x Q derivative of Y with respect to X.
processpca('dx',X,[],PS) returns the derivative, less efficiently.
processpca('name') returns the name of this process method.
processpca('pdefaults') returns default process parameter structure.
processpca('pdesc') returns the process parameter descriptions.
processpca('pcheck',fp) throws an error if any parameter is illegal.
Examples
Here is how to format a matrix with an independent row, a correlated row, and a completely redundant row so that its rows are uncorrelated and the redundant row is dropped.
x1_independent = rand(1,5) x1_correlated = rand(1,5) + x_independent; x1_redundant = x_independent + x_correlated x1 = [x1_independent; x1_correlated; x1_redundant] [y1,ps] = processpca(x1)
Next, apply the same processing settings to new values.
x2_independent = rand(1,5) x2_correlated = rand(1,5) + x_independent; x2_redundant = x_independent + x_correlated x2 = [x2_independent; x2_correlated; x2_redundant]; y2 = processpca('apply',x2,ps)
Reverse the processing of y1 to get x1 again.
Algorithm
Values in rows whose elements are not all the same value are set to
Values in rows with all the same value are set to 0.
See Also
fixunknowns, mapminmax, mapstd
| Provide feedback about this page |
![]() | postreg | purelin | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |