robustSvd             package:pcaMethods             R Documentation

_A_l_t_e_r_n_a_t_i_n_g _L_1 _S_i_n_g_u_l_a_r _V_a_l_u_e _D_e_c_o_m_p_o_s_i_t_i_o_n

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

     A robust approximation to the singular value decomposition of a
     rectangular matrix is computed using an alternating L1 norm
     (instead of the more usual least squares L2 norm).

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

       robustSvd(x)

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

       x: A matrix whose SVD decomposition is to be computed.  Missing
          values ARE allowed.

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

     As the SVD is a least-squares procedure, it is highly susceptible
     to outliers and in the extreme case, an individual cell (if
     sufficiently outlying) can draw even the leading principal
     component toward itself.

     See Hawkins et al (2001) for details on the robust SVD algorithm.
     Briefly, the idea is to sequentially estimate the left and right
     eigenvectors using an L1 (absolute value) norm minimization.

     Note that the robust SVD is able to accomodate missing values in
     the matrix 'x', unlike the usual 'svd' function.

     Also note that the eigenvectors returned by the robust SVD
     algorithm are NOT (in general) orthogonal and the eigenvalues need
     not be descending in order.

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

     The robust SVD of the matrix is x = u d v'. 

       d: A vector containing the singular values of 'x'.

       u: A matrix whose columns are the left singular vectors of 'x'.

       v: A matrix whose columns are the right singular vectors of 'x'.

_W_a_r_n_i_n_g:

     Two differences from the usual SVD may be noted. One relates to
     orthogonality. In the conventional SVD, all the eigenvectors are
     orthogonal even if not explicitly imposed.  Those returned by the
     AL1 algorithm (used here) are (in general) not orthogonal.

     Another difference is that, in the L2 analysis of the conventional
     SVD, the successive eigen triples (eigenvalue, left eigenvector,
     right eigenvector) are found in descending order of eigenvalue.
     This is not necessarily the case with the AL1 algorithm.  Hawkins
     et al (2001) note that a larger eigen value may follow a smaller
     one.

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

     Kevin Wright, modifications by Wolfram Stacklies

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

     Hawkins, Douglas M, Li Liu, and S Stanley Young (2001) Robust
     Singular Value Decomposition, National Institute of Statistical
     Sciences, Technical Report Number 122. <URL:
     http://www.niss.org/technicalreports/tr122.pdf>

_S_e_e _A_l_s_o:

     'svd', 'nipals' for an alternating L2 norm method that also
     accommodates missing data.

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

     ## Load a complete sample metabolite data set and mean center the data
     data(metaboliteDataComplete)
     mdc <- scale(metaboliteDataComplete, center=TRUE, scale=FALSE)
     ## Now create 5
     cond   <- runif(length(mdc)) < 0.05;
     mdcOut <- mdc
     mdcOut[cond] <- 10

     ## Now we do a conventional SVD and a robustSvd on both, the original and the 
     ## data with outliers.
     resSvd       <- svd(mdc)
     resSvdOut    <- svd(mdcOut)
     resRobSvd    <- robustSvd(mdc)
     resRobSvdOut <- robustSvd(mdcOut)

     ## Now we plot the results for the original data against those with outliers
     ## We can see that robustSvd is hardly effected by the outliers.
     plot(resSvd$v[,1], resSvdOut$v[,1])
     plot(resRobSvd$v[,1], resRobSvdOut$v[,1])

