|Re: [eigen] Including Spectra within Eigen 3.4|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Including Spectra within Eigen 3.4
- From: Bill Greene <w.h.greene@xxxxxxxxx>
- Date: Sun, 2 Apr 2017 11:43:31 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=WtAJCs1an7cuGLl5QRR75td746oARvf8oiMou7OXp2g=; b=cfnfU1z3qsGOZ5iYZ9F0/48bZT6Z4y8GoZ92hkNOxiZyCf2OJ7Ej1q/QxoIH7jeBHh 80VGembyscpWHvleVAvvQvLsVAnPdL3xS4ViD29DNIlwvibUDMhAkvsIo3LnNw462rDQ t9gIb+0VJparN9FRfA0qNIX46BKiiUGBk9OAhsu9Io7PkyMq868lkas1TmfZz9RDf63N s25pf7yuzeB74/TCrS9tg55vzkyvz99fEiZP6hwPsegxcWwUBKJbT5rRSr0wDT5KGUEt 0smS8kFM9dnbT+bdJ+61GxN4AwmSzZucD2w4qUCmEtnodnoqO9SRO7QrannC+sASgdoS TP0A==
The matrix in this test case is SPD so the simplest way to calculate
the SVD is to solve the eigenproblem
on the matrix itself. Spectra shows the same behavior on this
eigenproblem as with the SPD implementation.
I happened to notice that Arpack uses a default tolerance of machine
epsilon where Spectra is using a larger
value; so I simply reduced the tolerance.
On Sun, Apr 2, 2017 at 11:25 AM, Yixuan Qiu <yixuanq@xxxxxxxxx> wrote:
> Hi Oleg,
> I think part of the reason is that when using Spectra to compute SVD of X,
> we are actually calculating the eigenvalues of X'X or XX'. However, this
> doubles the condition number of X, and hence the numerical precision and
> stability is reduced.
> There are algorithms that can compute SVD without touching X'X, and I agree
> that these methods may be more appropriate for SVD problems. Bryan Lewis
> once wrote an article comparing the R pakcages "RSpectra" and "irlba", which
> also discussed the algorithm issues.
> 2017-04-02 10:59 GMT-04:00 Oleg Shirokobrod <oleg.shirokobrod@xxxxxxxxx>:
>> Thanks Bill.
>> Matlab lmsvd gives the same singular values with tolerance 1.e-8 as
>> Spectra code does with tolerance 1.e-10. It gives the same values with
>> tolerance 1.e-19 as Spectra does with tolerance 1.e-12. It uses algorithm
>> described in a paper: Xin Liu, Zaiwen Wen and Yin Zhang, Limited Memory
>> Block Krylov Subspace Optimization for Computing Dominant Singular Value
>> Decompositions, SIAM Journal on Scientific Computing, 35-3 (2013),
>> Does it mean that this algorithm converges faster than Spectra one?
>> Best regards,
>> Oleg Shirokobrod
> Yixuan Qiu <yixuanq@xxxxxxxxx>
> Department of Statistics,
> Purdue University