I have a 800x800 singular (covariance) matrix and I want to find it's largest eigenvalue and eigenvector corresponding to this eigenvalue.
Does anybody know wheter it is possible to do it with R?
see eigen function (e.g. result$values[1] and result$vectors[,1])
- Marc in the box
@Marcinthebox, it's not working for singular matrix
- user2080209
Ok, jumped the gun I guess. You may want to provide a small example. perhaps svd would find a solution where eigen does not.
- Marc in the box
@Marcinthebox, can't find how to use swd for my problem
- user2080209
1 Answers
1
votes
Here is an example of using svd for the decomposition of a covariance matrix:
a <- matrix(runif(16),4)
C <- cov(a)
res <- svd(C)
res
res$d[1] # largest singular value
res$u[,1] # largest vector ; u and v are the same
Hope that helps.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more
eigenfunction (e.g.result$values[1]andresult$vectors[,1]) - Marc in the boxsvdwould find a solution whereeigendoes not. - Marc in the box