How do I identify rows/columns that does not increase rank of matrix in R?

Lars Lau Raket

Suppose I have a symmetric, positive semidefinite matrix A of dimension n x n. The rank of A is d < n, and I want to find a set of indices of length d such that A[indices, indices] has rank d. For example, if

A <- structure(c(3, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), .Dim = c(4L, 4L))

then I would like to identify one of the sets of indices c(1, 2, 3) or c(1, 2, 4).

I can do this by brute force going through all combinations of rows and columns, but my guess is that there exist much more elegant and efficient methods for doing this.

Rorschach

You can use the QR decomposition, qr

q <- qr(A)
q$pivot[seq(q$rank)]
# [1] 1 2 3

A[,q$pivot[seq(q$rank)]]
#      [,1] [,2] [,3]
# [1,]    3    2    1
# [2,]    2    2    1
# [3,]    1    1    1
# [4,]    1    1    1

These resulting columns should be linearly independent.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to generate matrix with certain rank in R

From Dev

How do I convert a Matrix in R to a Vector

From Dev

How do I eliminate the rows of my matrix that don't contribute to its rank?

From Dev

How do I change the rank of a Gstreamer plugin?

From Dev

How do I change the rank of a Gstreamer plugin?

From Dev

How do I create a "rank" column in Excel?

From Dev

how do i rank the first place

From Dev

lme4::lmer reports "fixed-effect model matrix is rank deficient", do I need a fix and how to?

From Dev

How to utilize recursive functions to help rank matrix rows - R

From Dev

How to identify data does not exists in a variable in R

From Dev

How do I calculate the gradient of a matrix to draw a vector field in R?

From Dev

How do I create an empty matrix in R and update it using a for loop?

From Dev

What is the R file format of a dissimilarity matrix and how do I read it in?

From Dev

How do I append to a Document Term Matrix in R?

From Dev

In R: How do I test for membership of matrix elements in a list or a vector

From Dev

How do I get all entrys of a matrix with the same value in R

From Dev

How do I filter a matrix in R by matching another array

From Dev

How do I create a covariance matrix in R from MATLAB code?

From Dev

In R: How do I test for membership of matrix elements in a list or a vector

From Dev

How do I identify whether a number is an integer?

From Dev

Does numpy csr matrix "mean" function do the mean on all of the matrix? How can I remove a certain value?

From Dev

Why does as.numeric convert a matrix to a vector, and how do I keep the result as a matrix?

From Dev

How do I increase performance of FlowDocumentScrollViewer?

From Dev

How do I increase MySQL database size?

From Dev

How do I Increase Fontsize for text in richtextbox

From Dev

How do I increase cache size in Chrome?

From Dev

How do I increase the number of TTY consoles?

From Dev

How do I increase my root volume

From Dev

How do I increase the number of TTY consoles?

Related Related

  1. 1

    How to generate matrix with certain rank in R

  2. 2

    How do I convert a Matrix in R to a Vector

  3. 3

    How do I eliminate the rows of my matrix that don't contribute to its rank?

  4. 4

    How do I change the rank of a Gstreamer plugin?

  5. 5

    How do I change the rank of a Gstreamer plugin?

  6. 6

    How do I create a "rank" column in Excel?

  7. 7

    how do i rank the first place

  8. 8

    lme4::lmer reports "fixed-effect model matrix is rank deficient", do I need a fix and how to?

  9. 9

    How to utilize recursive functions to help rank matrix rows - R

  10. 10

    How to identify data does not exists in a variable in R

  11. 11

    How do I calculate the gradient of a matrix to draw a vector field in R?

  12. 12

    How do I create an empty matrix in R and update it using a for loop?

  13. 13

    What is the R file format of a dissimilarity matrix and how do I read it in?

  14. 14

    How do I append to a Document Term Matrix in R?

  15. 15

    In R: How do I test for membership of matrix elements in a list or a vector

  16. 16

    How do I get all entrys of a matrix with the same value in R

  17. 17

    How do I filter a matrix in R by matching another array

  18. 18

    How do I create a covariance matrix in R from MATLAB code?

  19. 19

    In R: How do I test for membership of matrix elements in a list or a vector

  20. 20

    How do I identify whether a number is an integer?

  21. 21

    Does numpy csr matrix "mean" function do the mean on all of the matrix? How can I remove a certain value?

  22. 22

    Why does as.numeric convert a matrix to a vector, and how do I keep the result as a matrix?

  23. 23

    How do I increase performance of FlowDocumentScrollViewer?

  24. 24

    How do I increase MySQL database size?

  25. 25

    How do I Increase Fontsize for text in richtextbox

  26. 26

    How do I increase cache size in Chrome?

  27. 27

    How do I increase the number of TTY consoles?

  28. 28

    How do I increase my root volume

  29. 29

    How do I increase the number of TTY consoles?

HotTag

Archive