Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Cholesky Decomposition

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104581] Re: [mg104516] Cholesky Decomposition
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Wed, 4 Nov 2009 01:36:46 -0500 (EST)
  • References: <200911030751.CAA01026@smc.vnet.net>
  • Reply-to: drmajorbob at yahoo.com

a = ({
     {1, 1, 1, 1},
     {1, 5, 5, 5},
     {1, 5, 14, 14},
     {1, 5, 14, 15}
    });

{lu, p, c} = LUDecomposition@a

{{{1, 1, 1, 1}, {1, 4, 4, 4}, {1, 1, 9, 9}, {1, 1, 1, 1}}, {1, 2, 3,
   4}, 1}

{l, u} = Through[{IdentityMatrix@Length@# +
       LowerTriangularize[#, -1] &, UpperTriangularize}@lu]

{{{1, 0, 0, 0}, {1, 1, 0, 0}, {1, 1, 1, 0}, {1, 1, 1, 1}}, {{1, 1, 1,
    1}, {0, 4, 4, 4}, {0, 0, 9, 9}, {0, 0, 0, 1}}}

l.u == a

True

Bobby

On Tue, 03 Nov 2009 01:51:39 -0600, Lars Schouw <schouwla at yahoo.com> wrote:

> How do I get out the lower triangular matrix after doing a Choleseky
> decomposition?
>
> I tried a LU decomposition but not get back what I expect.
>
> For example the symetrix matrix A
> 1 1 1 1
> 1 5 5 5
> 1 5 14 14
> 1 5 14 15
>
> is equal to the product of the tringular matrix L and its transposed
> L^T
> 1 1 1 1                    1 0 0 0      1 1 1 1
> 1 5 5 5         =         1 2 0 0      0 2 2 2
> 1 5 14 14                 1 2 3 0      0 0 3 3
> 1 5 14 15                 1 2 3 1      0 0 0 1
>
> With L
> 1 0 0 0
> 1 2 0 0
> 1 2 3 0
> 1 2 3 1
>
> But in Mathematica I do this:
> A = {{1, 1, 1, 1}, {1, 5, 5, 5}, {1, 5, 14, 14}, {1, 5, 14, 15}}
> {lu, p, c} = LUDecomposition[A]
> l = lu SparseArray[{i_, j_} /; j < i -> 1, {4, 4}] + IdentityMatrix[4]
>
> and get
> {{1, 0, 0, 0}, {1, 1, 0, 0}, {1, 1, 1, 0}, {1, 1, 1, 1}}
>
> Any idea what I am doing wrong?
>
> Lars
>
>


-- 
DrMajorBob at yahoo.com


  • Prev by Date: Re: Re: Mathematica and desktop search
  • Next by Date: Re: ForAll testing equality, and Limit evaluating wrong
  • Previous by thread: Re: Cholesky Decomposition
  • Next by thread: Re: Cholesky Decomposition