commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luc Maisonobe <Luc.Maison...@free.fr>
Subject Re: svn commit: r1384363 - in /commons/proper/math/trunk/src: changes/ main/java/org/apache/commons/math3/linear/ test/java/org/apache/commons/math3/linear/ test/java/org/apache/commons/math3/random/
Date Fri, 14 Sep 2012 19:31:47 GMT
Le 13/09/2012 19:10, Thomas Neidhart a écrit :
> On 09/13/2012 05:13 PM, luc@apache.org wrote:
>> Author: luc
>> Date: Thu Sep 13 15:13:03 2012
>> New Revision: 1384363
>>
>> URL: http://svn.apache.org/viewvc?rev=1384363&view=rev
>> Log:
>> Fixed an error in rectangular Cholesky decomposition.
>>
>> JIRA: MATH-789
> 
> Hi Luc,
> 
> thanks for looking into this.
> 
> I think that there is still an error in the way the rank is calculated
> in case diagonal values are below the threshold:
> 
> //all remaining diagonal elements are close to zero, we consider we have
> // found the rank of the symmetric positive semidefinite matrix
> //++r;   <- commented out
> loop = false;
> 
> Otherwise the resulting root Matrix may be rank deficient as can be seen
> in the examples below.

You are right. Could you make the change?

In fact, I wonder if we should test for values <=0 instead of using a
"small" parameter. Here is what Nicholas J. Higham writes in the
discussion section of his 1990 paper "Analysis of the Cholesky
Decomposition of a Semi-definite Matrix"
(<http://eprints.ma.man.ac.uk/1193/>), about the SCHDC function in Linpack.

  "Consequently, SCHDC proceeds with the Cholesky algorithm until a
   nonpositive pivot is encountered, that is, up to and including
   stage k − 1, where k is the smallest integer for which
      aii ≤ 0, i = k, ..., n"

Of course, users can set "small" to 0 themselves...

Luc

> 
> Actually there is a unit test (CorrelatedRandomVectorGeneratorTest) that
> tests for a wrong rank:
> 
>     @Test
>     public void testRank() {
>         Assert.assertEquals(3, generator.getRank());
>     }
> 
> Should be 2, see the resulting root Matrix:
> 
> Array2DRowRealMatrix{
> {2.0823861495,0.0605633926,0.0},
> {2.6016090812,0.0403755951,0.0},
> {3.1208320129,0.0201877975,0.0},
> {3.6400549446,0.0,0.0}}
> 
> with the fix the result is the following:
> 
> Array2DRowRealMatrix{
> {2.0823861495,0.0605633926},
> {2.6016090812,0.0403755951},
> {3.1208320129,0.0201877975},
> {3.6400549446,0.0}}
> 
> Thomas
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message