Questions tagged [matrix-inverse]

The matrix inverse, A^{-1}, is a mathematical relationship such that given a square n x n matrix A, A*A^{-1} = A^{-1}*A = I, where I is the identity matrix. Use this tag with regards to any numerical methods or computations that require the use or calculation of the matrix inverse.

Computation of the inverse of a square matrix, provided it is invertible (i.e., full-rank), is often via LU factorization. When the matrix is positive-definite, Cholesky factorization is often used. In standard numerical linear algebra library , dgesv and dpotrf respectively performs LU and Cholesky factorization.

In reality it is rare that a matrix inverse needs be explicitly formed, and matrix multiplications involving a matrix inverse is done by one of the factorizations above, and a triangular system solving.

509 questions
2
votes
1 answer

Solve for inverse square root

I have a positive definite matrix A of which I already computed the cholesky decomposition: A=LDL^T. For some vector x, I would like to compute S^{-1}x, where S is a square root of A. For now, I do Eigen::SelfadjointEigenSolver
yannick
  • 397
  • 3
  • 19
2
votes
3 answers

Matrices and inverse Matrices in Python

For a project that I am doing, I decompose a graph that I created using NetworkX into an adjacency matrix using the NetworkX adj_matrix() function. However, one of the problems that I have come across is that every single graph that I decompose…
GobiasKoffi
  • 4,014
  • 14
  • 59
  • 66
2
votes
0 answers

Matlab's `inv` function

After (quite a lengthy) discussion with Rody Oldenhuis here and another discussion here, I think it is best to make it a formal question: Why should one avoid using Matlab's inv()? What better alternatives exists for inv for different use cases?
Shai
  • 111,146
  • 38
  • 238
  • 371
2
votes
1 answer

Does Lapack check if a matrix is invertible before it tries to invert it

I use LAPACK in a c code that allows me to inverse a matrix. to be more precise, I use dgetrf_ then dgetri_ to do the inversion. But as I'm dealing with big matrices and as i don't know if the matrices will be invertible or not, I loose a lot of…
PinkFloyd
  • 2,103
  • 4
  • 28
  • 47
2
votes
2 answers

Lapack calls to invert a matrix

From my understanding, a decomposition/factorization (LU, QR, Cholesky, etc.) is required, followed by matrix inverse calculation based on the factorization. Are there any other ways of getting around it (I'm trying to figure out whether I can stick…
stanigator
  • 10,768
  • 34
  • 94
  • 129
2
votes
1 answer

Using inv() function in Matlab crashes using all the RAM

I have a sparse matrix in Matlab 43916x43916, which is calculated by this equation: B=(speye(nV,nV)-alpha*NeMatrix+beta*NeMatrix*NeMatrix); being nVa int, alphaa int, NeMatrix a sparse matrix and beta a int. I can't do inv(B) because it increases…
SamuelNLP
  • 4,038
  • 9
  • 59
  • 102
2
votes
2 answers

in R programming, concerning on inverse matrix and its multiplication

this is my solving process from the exercise of [a beginner's guide to R] > Q [,1] [,2] [,3] [1,] 1 2 3 [2,] 4 2 1 [3,] 2 3 0 > solve(Q) [,1] [,2] [,3] [1,] -0.12 0.36 -0.16 [2,] 0.08 -0.24 0.44 [3,] …
2
votes
2 answers

Is there a package for parallel matrix inversion in R

is there a package for matrix inversion in R using parallel computation? Thanks! Hello. I am having trouble installing the HiPLARb package, here is what I did: Download auto-installer script: http://www.hiplar.org/downloads/HiPLARb.Installer…
qed
  • 22,298
  • 21
  • 125
  • 196
2
votes
1 answer

Why are the inverse results not equal?

I mat a problem when solving inverse of a matrix. Firstly, I use python numpy library to make it, by coding below: import numpy as np mtx_str = '1 0.05336904 1.03164031 0.05505765;1 0.05248641 3.0928260 0.16233134;1 2.16503202 1.03197617 …
xunzhang
  • 2,838
  • 6
  • 27
  • 44
2
votes
2 answers

Symbolic inverse of a matrix in R

How can I find the symbolic inverse of a matrix in R; for example: Matrix.test <- function(x) matrix(c(x, x^2, x^3, x^4, x^5, x^6, x^7, x^8, x^9, 2*x, 3*x, 4*x, 2*x^2, 3*x^3, 4*x^4, 5*x^5), 4, 4) I Know there is a package called 'Ryacas' which is…
Ehsan Masoudi
  • 712
  • 10
  • 19
2
votes
3 answers

MatLab - algorithm for finding inverse of matrix

I am trying to write an algorithm in MatLab which takes as its input a lower triangular matrix. The output should be the inverse of this matrix (which also should be in lower triangular form). I have almost managed to solve this, but one part of…
Kristian
  • 1,239
  • 12
  • 31
  • 44
2
votes
1 answer

Good matrix inversion routines in C

As part of a python code for a numerical calculation, I must invert somewhat large (sparse) matrices (~100x100) many times. I would really like to speed up the program, and one of the ways suggested to me is to call to a subroutine in C for the…
AKC
  • 21
  • 2
2
votes
3 answers

Symmetric Matrix Inversion in C using CBLAS/LAPACK

I am writing an algorithm in C that requires Matrix and Vector multiplications. I have a matrix Q (W x W) which is created by multiplying the transpose of a vector J(1 x W) with itself and adding Identity matrix I, scaled using scalar a. Q =…
Saed
  • 357
  • 1
  • 7
  • 12
1
vote
2 answers

Matlab Returns "FAIL" When Trying to Invert Matrix

I'm trying to invert a matrix with some symbolic variables, but Matlab just returns 'FAIL'. I'm using inv(K). This is K that Matlab outputs after some computation: K = [ 11/80, 7/80, -11/80, -7/80, 0, 0] [ 7/80, 11/80, -7/80, -11/80, 0,…
user1114864
  • 1,734
  • 6
  • 26
  • 37
1
vote
2 answers

Inverse of matrix and multiplication

I am new to world of matrix, sorry for this basic question I could not figure out: I have four matrix (one unknown). Matrix X x <- c(44.412, 0.238, -0.027, 93.128, 0.238, 0.427, -0.193, 0.673, 0.027, -0.193, 0.094, -0.428, 93.128, 0.673,…
jon
  • 11,186
  • 19
  • 80
  • 132