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:
improving the condition number of a matrix

Subject: improving the condition number of a matrix

From: El

Date: 22 Jul, 2013 13:20:13

Message: 1 of 4

Hi,

I generate a matrix with random elements and it is supposed to be full rank, but sometimes the condition number of the matrix is low and I get this warning: system is rank deficient. solution is not unique. How can I improve the condition number for this cases?

Thank you,
El

Subject: improving the condition number of a matrix

From: Nasser M. Abbasi

Date: 22 Jul, 2013 18:04:51

Message: 2 of 4

On 7/22/2013 8:20 AM, El wrote:
> Hi,
>
> I generate a matrix with random elements and it is supposed to be full rank,

If it is a random generated, how would you guarantee this?

>but sometimes the condition number of the matrix is low and I get this warning: system is rank
>deficient. solution is not unique.

strange, since condition number is better when it is small.
The closer to one the better, since m=log(cond(A)), and m is
number of significant digits lost in computing solution of Ax=b.

So the larger the cond(A) the less accuracy one
expects x to be. May be you meant the inverse of the condition
number became smaller?

>How can I improve the condition number for this cases?
>

Well, since it is random matrix, why not try again another random one?

If you do not want to do that, try to add some noise to the same A matrix.
(which is really the same as making a new random matrix).

By one definition, cond(A)= largest_eigenvalue/smallest_eigenvalue
(in absolute terms), so to make cond(A) small, you need at best to have
the matrix have all its eigenvalues be the same.

These are roots of the matrix char. polynomial. I am not an
expert on this, and I do not know how to do that in direct way.
May be others would know.

But for now, try adding some random noise to the matrix, I am sure the
condition number will change.


> Thank you,
> El
>

Subject: improving the condition number of a matrix

From: El

Date: 22 Jul, 2013 20:41:10

Message: 3 of 4

"Nasser M. Abbasi" wrote in message <ksjs8b$80g$1@speranza.aioe.org>...
> On 7/22/2013 8:20 AM, El wrote:
> > Hi,
> >
> > I generate a matrix with random elements and it is supposed to be full rank,
>
> If it is a random generated, how would you guarantee this?
>
> >but sometimes the condition number of the matrix is low and I get this warning: system is rank
> >deficient. solution is not unique.
>
> strange, since condition number is better when it is small.
> The closer to one the better, since m=log(cond(A)), and m is
> number of significant digits lost in computing solution of Ax=b.
>
> So the larger the cond(A) the less accuracy one
> expects x to be. May be you meant the inverse of the condition
> number became smaller?
>
> >How can I improve the condition number for this cases?
> >
>
> Well, since it is random matrix, why not try again another random one?
>
> If you do not want to do that, try to add some noise to the same A matrix.
> (which is really the same as making a new random matrix).
>
> By one definition, cond(A)= largest_eigenvalue/smallest_eigenvalue
> (in absolute terms), so to make cond(A) small, you need at best to have
> the matrix have all its eigenvalues be the same.
> These are roots of the matrix char. polynomial. I am not an
> expert on this, and I do not know how to do that in direct way.
> May be others would know.
>
> But for now, try adding some random noise to the matrix, I am sure the
> condition number will change.
>
>
> > Thank you,
> > El
> >
I am also not an expert, so I made a mistake in the previous message, I need a lower condition number. I need to calculate something for large number of different random matrices and then to find the average value, but for some matrix realization I get a warning: system is rank deficient. solution is not unique.
How can I find for which condition number the matrix will be ill conditioned to restrict this behavior?

Thank you a lot,
El

Subject: improving the condition number of a matrix

From: Nasser M. Abbasi

Date: 22 Jul, 2013 21:40:07

Message: 4 of 4


> I am also not an expert,

great. So we are two non-experts on the subjects talking about it ;)

> How can I find for which condition number the matrix will be ill conditioned to restrict this behavior?
>

condition number of 10^n will loss b digits of precision in the solution x.
You decide how many digits of precision you are will to lose in the solution.
only 3 digits? then you want condition number < 1000 and so on.

There is no one number that will fit everyone, it depends on your problem.
The lower the condition number, the more accurate the solution will be.


--Nasser

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