Description Usage Arguments Value References
In the classical singular value decomposition (SVD), the singular values and the singular vectors are computed based on an L2 norm. However, the L2 norm is easily misled by even a single sufficiently large outlier due to the values being squared. Another option is to use an L1 norm, which works with absolute values. Unfortunately, the L1 norm is not always as straightforward or fast to compute. This function implements the AL1 algorithm of Hawkins (2001). The algoritm is capable of reaching the L1-norm solution to SVD, but does so through an alternating L1-regression algorithm which is not as efficient as classical SVD algorithms. For very large data sets, it will likely be too slow and inefficient for practical use. The AL1 algorithm also does not sort singular vectors by the decreasing order of the singular values, however, this is easily taken care of and this function returns the sorted vectors and values. L1-normed singular vectors are also not necessarily orthogonal, however, the implementation here allows for orthogonalizing the results.
1 | svdL1(x, maxit = 500, tol = 1e-05, interp = F)
|
x |
a data frame or matrix of numeric covariates |
maxit |
the maximum number of iterations for the approximation algorithm. defaults to 500. |
tol |
convergence tolerance. defaults to 1e-4 |
interp |
should values be interpolated during the calculation of L1 weighted svd? Since the calculations entail calculating weighted medians, and weighted medians are not always unique, this will smooth the values as to obtain a unique solution. this can come at the cost of accuracy, however, as well as substantially slow down both the rate of convergence and rate of calculations at each iteration, so the default is FALSE. However, if convergence problems occur with this option set to FALSE, it may be worth trying interp=TRUE. |
a list containing singular values and left and right singular vectors, along with convergence information and number of iterations for each singular vector.
Hawkins, D.M., Liu, L., & Young, S.S. (2001) Robust Singular Value Decomposition, National Institute of Statistical Sciences, Technical Report Number
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.