Google Группы больше не поддерживают новые публикации и подписки в сети Usenet. Опубликованный ранее контент останется доступен.

What function to use to find matrix condition number?

878 просмотров
Перейти к первому непрочитанному сообщению

Nasser M. Abbasi

не прочитано,
3 дек. 2010 г., 05:22:1503.12.2010
This is version 8:

I'd like to use LinearAlgebra`MatrixConditionNumber to find
condition number of some matrix.

btw, This command lists the functions in linear algebra.
Names["LinearAlgebra`*"]

But Mathematica says this package is now obsolete, and
functionality is now in the kernel.

<<LinearAlgebra`
General::obspkg: {At Line = 3, the input was:,
<<LinearAlgebra`,LinearAlgebra`} is now obsolete. The
legacy version being loaded may conflict with current
Mathematica functionality. See the Compatibility Guide for
updating information. >>

But When I follow the above, I get to page, where at the bottom
it shows 3 functions, one of them is MatrixConditionNumber,
but it does not show what replaced it in the kernel, instead
it points to a link to MathSource article:

"These functions were available in previous versions of Mathematica
and are now available on the web at
library.wolfram.com/infocenter/MathSource/6770"

?

So, is there no build-in function to compute condition number now
in Mathematica?

I know I can find the max eigenvalue, divide it by the min
eigenvalue (absolute values), and this gives me the condition
number. But should not such a function be part of the system?

Or may be I overlooked it? I did search for it, can't find it
in the documenation center.

btw, I did also try the natural language interface also, and I asked
W/ALpha by typing

= matrix condition number

but it replied back with a chemical formula C16 H13 C1 N2 O, named diazepam, which is not what I wanted.

thanks,
--Nasser

Oliver Ruebenkoenig

не прочитано,
3 дек. 2010 г., 06:30:4003.12.2010

Hi Nasser,

On Fri, 3 Dec 2010, Nasser M. Abbasi wrote:

> This is version 8:
>
> I'd like to use LinearAlgebra`MatrixConditionNumber to find
> condition number of some matrix.
>
> btw, This command lists the functions in linear algebra.
> Names["LinearAlgebra`*"]
>
> But Mathematica says this package is now obsolete, and
> functionality is now in the kernel.
>
> <<LinearAlgebra`
> General::obspkg: {At Line = 3, the input was:,
> <<LinearAlgebra`,LinearAlgebra`} is now obsolete. The
> legacy version being loaded may conflict with current
> Mathematica functionality. See the Compatibility Guide for
> updating information. >>
>
> But When I follow the above, I get to page, where at the bottom
> it shows 3 functions, one of them is MatrixConditionNumber,
> but it does not show what replaced it in the kernel, instead
> it points to a link to MathSource article:
>
> "These functions were available in previous versions of Mathematica
> and are now available on the web at
> library.wolfram.com/infocenter/MathSource/6770"
>
> ?
>
> So, is there no build-in function to compute condition number now
> in Mathematica?
>

I made the suggestion that MatrixConditionNumber become a true kernel
function.

I still use the LinearAlgebra`MatrixConditionNumber to find the condition
number.

> I know I can find the max eigenvalue, divide it by the min
> eigenvalue (absolute values), and this gives me the condition
> number. But should not such a function be part of the system?
>

Yes, I agree.

Oliver

Daniel Lichtblau

не прочитано,
4 дек. 2010 г., 06:12:5604.12.2010
Nasser M. Abbasi wrote:
> This is version 8:
>
> I'd like to use LinearAlgebra`MatrixConditionNumber to find
> condition number of some matrix.
>
> btw, This command lists the functions in linear algebra.
> Names["LinearAlgebra`*"]
>
> But Mathematica says this package is now obsolete, and
> functionality is now in the kernel.
>
> <<LinearAlgebra`
> General::obspkg: {At Line = 3, the input was:,
> <<LinearAlgebra`,LinearAlgebra`} is now obsolete. The
> legacy version being loaded may conflict with current
> Mathematica functionality. See the Compatibility Guide for
> updating information. >>
>
> But When I follow the above, I get to page, where at the bottom
> it shows 3 functions, one of them is MatrixConditionNumber,
> but it does not show what replaced it in the kernel, instead
> it points to a link to MathSource article:
>
> "These functions were available in previous versions of Mathematica
> and are now available on the web at
> library.wolfram.com/infocenter/MathSource/6770"
>
> ?
>
> So, is there no build-in function to compute condition number now
> in Mathematica?
>
> I know I can find the max eigenvalue, divide it by the min
> eigenvalue (absolute values), and this gives me the condition
> number. But should not such a function be part of the system?

Actually it is the singular values you should divide. This gives the l_2
condition number. If the matrix is real and symmetric (or complex and
Hermitian) then the eigenvalue quotients you mention will also work.


> Or may be I overlooked it? I did search for it, can't find it
> in the documenation center.
>
> btw, I did also try the natural language interface also, and I asked
> W/ALpha by typing
>
> = matrix condition number
>
> but it replied back with a chemical formula C16 H13 C1 N2 O, named diazepam, which is not what I wanted.
>
> thanks,
> --Nasser

You can get a good estimate of the l_infinity condition number from the
third element in the result of LUDecomposition.

In[14]:= mat = RandomReal[1,{4,4}];

In[16]:= LUDecomposition[mat][[3]]
Out[16]= 13.1224

See Documentation Center page for LUDecomposition, More Information.
Also if you type "condition number" into the search pane then
LUDecomposition and SingularValueList are listed second and third in the
results. That said, I agree with you that a dedicated function for this
could be useful.

Daniel Lichtblau
Wolfram Research

0 новых сообщений