search for: svd

Displaying 20 results from an estimated 379 matches for "svd".

Did you mean: sd
2007 Oct 17
3
Observations on SVD linpack errors, and a workaround
Lately I'm getting this error quite a bit: Error in La.svd(x, nu, nv) : error code 1 from Lapack routine 'dgesdd' I'm running R 2.5.0 on a 64 bit Intel machine running Fedora (8 I think). Maybe the 64 bit platform is more fragile about declaring convergence. I'm seeing way more of these errors than I ever have before. From R-Help I see...
2004 Jul 27
4
SVD with positivity constraints
Hello, I have a matrix equation, Ax=b, that I need to solve for x. x should be a vector of positive numbers (between 0 and 1). A is not a square matrix in general. This lead me to using the SVD. However, using the SVD gives me positive and negative numbers, as well. I have some constraints included in the A matrix itself (i.e., that the sum of some xi should be equal to 1) but I do not know how to include the constraint that each xi should be non-negative. Is there in R (or somewhere els...
2008 May 16
1
Dimensions of svd V matrix
Hi, I'm trying to do PCA on a n by p wide matrix (n < p), and I'd like to get more principal components than there are rows. However, svd() only returns a V matrix of with n columns (instead of p) unless the argument nv=p is set (prcomp calls svd without setting it). Moreover, the eigenvalues returned are always min(n, p) instead of p, even if nv is set: > x <- matrix(rnorm(15), 3, 5) > dim(svd(x)$v) [1] 5 3 > leng...
2010 Jan 16
2
La.svd of a symmetric matrix
Dear R list users, the singluar value decomposition of a symmetric matrix M is UDV^(T), where U = V. La.svd(M) gives as output three elements: the diagonal of D and the two orthogonal matrices u and vt (which is already the transpose of v). I noticed that the transpose of vt is not exactly u. Why is that? thank you for your attention and your help Stefano AVVISO IMPORTANTE: Questo messaggio di posta e...
2000 Aug 10
1
svd error (PR#631)
--=====================_24736660==_ Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Transfer-Encoding: quoted-printable SVD-Error on R 1.1.0 Windows 98 I get the following error applying svd on a positive definite matrix : > sk2 [,1] [,2] [,3] [,4] [,5] [1,] 1.0460139783 0.084356992 -2.810553e-04 -1.303237e-03 2.011809e-03 [2,] 0.0843569924 1.154650879 -5....
2002 Nov 17
1
SVD for reducing dimensions
...? The angle is all that is really important, I'd like 1,1,1,2 to be basically the same as 2,2,2,4, perhaps with that the latter having more weight in resolving disrepencies. Next is the job of reducing the matrix from 500 dimensions to say 10. I think the correct way of doing this is using SVD, does that sound right? At least, I have read a paper by Schuetze which used SVD. Other algorithms (K-means, SOM) also sound applicable but may balk at the amount of data, or might not provide the distance property I'm trying to get. However I must be doing something stupid here because th...
2003 Feb 06
6
Confused by SVD and Eigenvector Decomposition in PCA
...e the data matrix X is zero-meaned, and I used the following procedures: C = covriance(X) %% calculate the covariance matrix; [EVector,EValues]=eig(C) %% L = diag(EValues) %%L is a column vector with eigenvalues as the elements percent = L(1)/sum(L); Others argue using Sigular Value Decomposition(SVD) to calculate the same quantity, as: [U,S,V]=svd(X); L = diag(S); L = L.^2; percent = L(1)/sum(L); So which way is the correct method to calculate the percentage explained by the first principal component? Thanks for your advices on this. Fred
2002 Apr 01
3
svd, La.svd (PR#1427)
(I tried to send this earlier, but it doesnt seem to have come through, due to problems on my system) Hola: Both cannot be correct: > m <- matrix(1:4, 2) > svd(m) $d [1] 5.4649857 0.3659662 $u [,1] [,2] [1,] -0.5760484 -0.8174156 [2,] -0.8174156 0.5760484 $v [,1] [,2] [1,] -0.4045536 0.9145143 [2,] -0.9145143 -0.4045536 > La.svd(m) $d [1] 1.126182e-301 4.226051e-314 $u [,1] [,2] [1,] 0.0021125...
2008 Apr 15
1
SVD of a variance matrix
Hello! I suppose this is more a matrix theory question than a question on R, but I will give it a try... I am using La.svd to compute the singular value decomposition (SVD) of a variance matrix, i.e., a symmetric nonnegative definite square matrix. Let S be my variance matrix, and S = U D V' be its SVD. In my numerical experiments I always got U = V. Is this necessarily the case? Or I might eventually run into a SV...
2011 Sep 13
1
SVD Memory Issue
I am trying to perform Singular Value Decomposition (SVD) on a Term Document Matrix I created using the 'tm' package. Eventually I want to do a Latent Semantic Analysis (LSA). There are 5677 documents with 771 terms (the DTM is 771 x 5677). When I try to do the SVD, it runs out of memory. I am using a 12GB Dual core Machine with Windows XP and...
2012 Dec 05
1
Understanding svd usage and its necessity in generalized inverse calculation
Dear R-devel: I could use some advice about matrix calculations and steps that might make for faster computation of generalized inverses. It appears in some projects there is a bottleneck at the use of svd in calculation of generalized inverses. Here's some Rprof output I need to understand. > summaryRprof("Amelia.out") $by.self self.time self.pct total.time total.pct "La.svd" 150.34 27.66 164.82 30.32 &quot...
2001 Nov 16
2
DGESDD from Lapack for R-1.4.0?
Hi, I'm just wondering if it is planned to include the Lapack routine DGESDD (and friends) in R-1.4.0? This is faster (supposedly by a factor of ~6 for large matrices) than DGESVD which is currently (R-1.3.1) called by La.svd. And if it is not in the plans yet, is there a chance it could be? I've added it to my local version of R-1.3.1 and so far see a factor of 4 improvement over La.svd and a factor of 3 over svd (see output below). I'd be glad to hand off what I...
2002 Oct 29
0
patch to mva:prcomp to use La.svd instead of svd (PR#2227)
Per the discussion about the problems with prcomp() when n << p, which boils down to a problem with svd() when n << p, here is a patch to prcomp() which substitutes La.svd() instead of svd(). -Greg (This is really a feature enhancement, but submitted to R-bugs to make sure it doesn't get lost. ) *** R-1.6.0/src/library/mva/R/prcomp.R Mon Aug 13 17:41:50 2001 --- R-1.6.0-GRW//src/library...
2000 Jul 05
0
svd() (Linpack) problems/bug for ill-conditioned matrices (PR#594)
After fixing princomp(), recently, {tiny negative eigen-values are possible for non-negative definite matrices} Fritz Leisch drew my attention to the fact the not only eigen() can be funny, but also svd(). Adrian Trappleti found that the singular values returned can be "-0" instead of "0". This will be a problem in something like sd <- svd(Mat) $ d max(sd) / min(sd) which gives -Inf instead of Inf in the above case. I did some more searching and testing with...
2001 Sep 06
1
svd and eigen
Hello List, i need help for eigen and svd functions. I have a non-symmetric square matrix. These matrix is not positive (some eigenvalues are negative). I want to diagonalise these matrix. So, I use svd and eigen and i compare the results. eigen give me the "good" eigenvalues (positive and negative). I compare with another so...
2013 Apr 08
3
SVD on very large data matrix
Dear All, I need to perform a SVD on a very large data matrix, of dimension ~ 500,000 x 1,000 , and I am looking for an efficient algorithm that can perform an approximate (partial) SVD to extract on the order of the top 50 right and left singular vectors. Would be very grateful for any advice on what R-packages are available to p...
2001 Nov 02
1
Look, Watson! La.svd & ATLAS
...th many contributors. Type `contributors()' for more information. Type `demo()' for some demos, `help()' for on-line help, or `help.start()' for a HTML browser interface to help. Type `q()' to quit R. > set.seed(1) > x <- matrix(runif(1e4), 1e2, 1e2) > invisible(La.svd(x)) # This ran fine. > x <- matrix(runif(1e5), 1e3, 1e2) > invisible(La.svd(x)) (Dr. Watson says there's an access violation.) So far La.svd is the only thing I know of that generates Dr. Watson. The version info: _ platfor...
2010 Sep 22
3
eigen and svd
Dear R-helpers, could anybody explain me briefly what is the difference between eigenvectors returned by 'eigen' and 'svd' functions and how they are related? Thanks in advance Ondrej Mikula
2005 Jan 27
2
svd error
Hi, I met a probem recently and need your help. I would really appreciate it. I kept receiving the following error message when running a program: 'Error in svd(X) : infinite or missing values in x'. However, I did not use any svd function in this program though I did include the function pseudoinverse. Is the problem caused by doing pseudoinverse? Best regards, Tongtong
2003 Jul 03
2
SVD and spectral decompositions of a hermitian matrix
...put it back, I don't get the original hermitian matrix. I am having the same problem with spectral value decomposition as well. I am using R 1.7.0 on Windows. Here is my code: X <- matrix(rnorm(16)+1i*rnorm(16),4) X <- X + t(X) X[upper.tri(X)] <- Conj(X[upper.tri(X)]) Y <- La.svd(X) Y$u %*% diag(Y$d) %*% t(Y$v) # this doesn't give back X Y$u %*% diag(Y$d) %*% Y$v # this works fine. Z <- La.eigen(X) # the eigen values should be real, but are not. Z$vec %*% diag(Z$val) %*% t(Z$vec) # this doesn't give back X The help for "La.svd" says that the...