Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Best Way to Invert a Matrix (When You Really Need the Inverse)

Subject: Best Way to Invert a Matrix (When You Really Need the Inverse)

From: Bill Woessner

Date: 20 Sep, 2011 14:55:44

Message: 1 of 3

I'm doing a nonlinear least squares fit and I need to invert the
Hessian to obtain the parameter covariance estimate. So this is one
of those rare instances when I really need the inverse of a matrix.
The Hessian is pretty big (5424x5424), very sparse (density ~10^-4),
positive-definite and banded with a bandwidth of 2713. Is there a
better method than simply inv(H)?

Thanks in advance,
Bill

Subject: Best Way to Invert a Matrix (When You Really Need the Inverse)

From: Matt J

Date: 20 Sep, 2011 15:38:13

Message: 2 of 3

Bill Woessner <woessner@gmail.com> wrote in message <b7116035-f76d-46a7-96e1-9b3e961718c5@f17g2000yqh.googlegroups.com>...
> I'm doing a nonlinear least squares fit and I need to invert the
> Hessian to obtain the parameter covariance estimate. So this is one
> of those rare instances when I really need the inverse of a matrix.
> The Hessian is pretty big (5424x5424), very sparse (density ~10^-4),
> positive-definite and banded with a bandwidth of 2713. Is there a
> better method than simply inv(H)?
====================

If you only need certain particular elements of inv(H), (e.g. the diagonal if you only need the variances), then you might try using Cramer's rule. The sparsity might work to your advantage in the determinant computations.

Subject: Best Way to Invert a Matrix (When You Really Need the Inverse)

From: Dominique

Date: 20 Sep, 2011 16:06:30

Message: 3 of 3

Bill Woessner <woessner@gmail.com> wrote in message <b7116035-f76d-46a7-96e1-9b3e961718c5@f17g2000yqh.googlegroups.com>...
> I'm doing a nonlinear least squares fit and I need to invert the
> Hessian to obtain the parameter covariance estimate. So this is one
> of those rare instances when I really need the inverse of a matrix.
> The Hessian is pretty big (5424x5424), very sparse (density ~10^-4),
> positive-definite and banded with a bandwidth of 2713. Is there a
> better method than simply inv(H)?
>
> Thanks in advance,
> Bill

Greetings

I had the same issue last year. I searched a lot through the internet (including research papers). What I found is that the easy way is to calculate INV(H). However, with a sparse matrix as input, you will get a dense matrix (even using "tricks" as Cholesky decomposition) for output. Algorithms for inversing a matrix are rare as ironically a lot of people think that you can avoid using it most of the time. But as you say, there are cases when you absolutely need it.

I didn't find anything for sparse matrix inversion that is both efficient for time and disk storage. But it was a year ago, so there may be some developments since then.

Here are some web links that may be of use:

http://www.aanalytics.com/products.htm
http://ljk.imag.fr/membres/Bill.Triggs/src/
http://www.cise.ufl.edu/research/sparse/codes/
http://eigen.tuxfamily.org/index.php?title=SparseMatrix
http://www.cise.ufl.edu/research/sparse/
http://www.pardiso-project.org/

Sorry I couldn't help you more. It is not an easy problem.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us