nlpca               package:pcaMethods               R Documentation

_N_o_n-_l_i_n_e_a_r _P_C_A

_D_e_s_c_r_i_p_t_i_o_n:

     Neural network based non-linear PCA

_U_s_a_g_e:

     nlpca(Matrix, nPcs=2, center=TRUE, completeObs=TRUE, maxSteps=2*prod(dim(Matrix)), unitsPerLayer=NULL, functionsPerLayer=NULL, weightDecay=0.001, weights=NULL, verbose=interactive(), ...)

_A_r_g_u_m_e_n_t_s:

  Matrix: 'matrix' - Data containing the variables in columns and
          observations in rows. The data may contain missing values,
          denoted as 'NA'

    nPcs: 'numeric' - Number of components to estimate. The preciseness
          of the missing value estimation depends on thenumber of
          components, which should resemble the internal structure of
          the data.

  center: 'boolean' Mean center the data if TRUE

completeObs: 'boolean' Return the complete observations if TRUE. This
          is the original data with NA values filled with the estimated
          values.

maxSteps: 'numeric' - Number of estimation steps. Default is based on a
          generous rule of thumb.

unitsPerLayer: The network units, example: c(2,4,6) for two input units
          2feature units (principal components), one hidden layer
          fornon-linearity and three output units (original amount
          ofvariables).

functionsPerLayer: The function to apply at each layer eg. c("linr",
          "tanh", "linr") 

weightDecay: Value between 0 and 1.

 weights: Starting weights for the network. Defaults to uniform random
          values but can be set specifically to make algorithm
          deterministic.

 verbose: 'boolean' - nlpca prints the number of steps and warning
          messages if set to TRUE. Default is interactive().

     ...: Reserved for future use. Not passed on anywhere.

_D_e_t_a_i_l_s:

     Artificial Neural Network (MLP) for performing non-linear PCA.
     Non-linear PCA is conceptually similar to classical PCA but
     theoretically quite different. Instead of simply decomposing our
     matrix (X) to scores (T) loadings (P) and an error (E) we train a
     neural network (our loadings) to find a curve through the
     multidimensional space of X that describes a much variance as
     possible. Classical ways of interpreting PCA results are thus not
     applicable to NLPCA since the loadings are hidden in the network.
     However, the scores of components that lead to low
     cross-validation errors can still be interpreted via the score
     plot.

     Unfortunately this method depend on slow iterations which
     currently are implemented in R only making this method extremely
     slow. Furthermore, the algorithm does not by itself decide when it
     has converged but simply does 'maxSteps' iterations.

_V_a_l_u_e:

  pcaRes: Standard PCA result object used by all PCA-basedmethods of
          this package. Contains scores, loadings, data meanand more.
          See 'pcaRes' for details.

_A_u_t_h_o_r(_s):

     Based on a matlab script by Matthias Scholz
     <matthias.scholz[at]uni-greifswald.de> and ported to R by
     HenningRedestig <redestig[at]mpimp-golm.mpg.de>

_R_e_f_e_r_e_n_c_e_s:

     Matthias Scholz, Fatma Kaplan, Charles L Guy, Joachim Kopkaand
     Joachim Selbig. Non-linear PCA: a missing dataapproach.
     _Bioinformatics, 21(20):3887-3895, Oct 2005_

_E_x_a_m_p_l_e_s:

     # Data set with three variables where data points constitute a helix
     data(helix)
     helixNA <- helix
     helixNA <- t(apply(helix, 1, function(x) { x[sample(1:3, 1)] <- NA; x})) # not a single complete observation
     helixNlPca <- pca(helixNA, nPcs=1, method="nlpca", maxSteps=1000)
     fittedData <- fitted(helixNlPca, helixNA)
     plot(fittedData[which(is.na(helixNA))], helix[which(is.na(helixNA))])
     # compared to solution by Nipals PCA that cannot extract non-linear patterns
     helixNipPca <- pca(helixNA, nPcs=2, method="nipals")
     fittedData <- fitted(helixNipPca)
     plot(fittedData[which(is.na(helixNA))], helix[which(is.na(helixNA))])

