Fwd: Re: CholeskyDecomposition


Sender: "Niko Brummer" <niko.brummer@gmail.com>
Subject: Re: CholeskyDecomposition


Hi Sione

Try L*L',

The order you used L'*L works in MATLAB, which in fact returns an
*upper* triangular Cholesky factor. Jama returns a *lower* triangular
factor.

(Also make sure you have the latest version of Jama. In the original
version, there was a bug in some of the Cholesky code.)

Niko

On 03/05/07, Sione <sionep@xtra.co.nz> wrote:
> Hello All,
>
> I have a question about the CholeskyDecomposition.  The following code
> snippets shows a reconstruction of  a matrix from a
> CholeskyDecomposition and the result is not the same as the original one.
>
> -------- sample code -----------
>
> double[][] h = new double[][]{
>     {4532 , 5682 },
>     {5634 ,  7134}
>   }
>
> Matrix H = new Matrix(h);
>
> CholeskyDecomposition chol = H.chol();
>
> Matrix L = chol.getL();
>
> Matrix LtL = L.transpose().times(L);
>
>
> System.out.println("\n =========== H ==========");
> H.print(6,0);
>
> System.out.println("\n =========== L ==========");
> L.print(6,4);
>
> System.out.println("\n =========== L'*L ==========");
> LtL.print(6,4);
>
> --------- end sample code ------------
>
>
>
> The output gave me this:
>
> =========== H ==========
>
>  4532  5682
>
>  5634  7134
>
>
> =========== L ==========
>  67.3201   0.0000
>
>  83.6897  11.4034
>
>
> =========== L'*L ==========
> 11535.9620  954.3484
>
>  954.3484  130.0380
>
>
> My question is why the reconstruction  L'*L  is not the same as  H ?
>
>
> Cheers,
> Sione.
>
>
>
>
> ----- End forwarded message -----
>
>
>
>


----- End forwarded message -----





Date Index | Thread Index | Problems or questions? Contact list-master@nist.gov