[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

45. cholesky


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

45.1 Definiciones para cholesky

Función: cholesky (A)

Calcula la descomposición de Cholesky de A, una matriz triangular inferior L tal que L . transpose(L) = A.

A continuación algunos ejemplos.

Ejemplo 1:

 
(%i1) load("cholesky")$

(%i2) A : matrix ([a, b, c], [d, e, f], [g, h, i]);
                        [ a  b  c ]
                        [         ]
(%o2)                   [ d  e  f ]
                        [         ]
                        [ g  h  i ]
(%i3) A2 : transpose (A) . A;
      [   2    2    2                                     ]
      [  g  + d  + a     g h + d e + a b  g i + d f + a c ]
      [                                                   ]
(%o3) [                    2    2    2                    ]
      [ g h + d e + a b   h  + e  + b     h i + e f + b c ]
      [                                                   ]
      [                                     2    2    2   ]
      [ g i + d f + a c  h i + e f + b c   i  + f  + c    ]
(%i4) B : cholesky (A2)$

(%i5) B . transpose (B) - A2;
                        [ 0  0  0 ]
                        [         ]
(%o5)                   [ 0  0  0 ]
                        [         ]
                        [ 0  0  0 ]

Ejemplo 2:

 
(%i6) A : matrix ([2, 3, 4], [-2, 2,- 3], [11, -2, 3]);
                    [  2    3    4  ]
                    [               ]
(%o6)               [ - 2   2   - 3 ]
                    [               ]
                    [ 11   - 2   3  ]
(%i7) A2 : transpose (A) . A;
                    [ 129   - 20  47 ]
                    [                ]
(%o7)               [ - 20   17   0  ]
                    [                ]
                    [  47    0    34 ]
(%i8) B : cholesky (A2);
       [  sqrt(129)         0             0      ]
       [                                         ]
       [      20        sqrt(1793)               ]
       [ - ---------    ----------        0      ]
(%o8)  [   sqrt(129)    sqrt(129)                ]
       [                                         ]
       [     47       940 sqrt(129)      153     ]
       [  ---------   --------------  ---------- ]
       [  sqrt(129)   129 sqrt(1793)  sqrt(1793) ]
(%i9) B . transpose (B) - A2;
                       [ 0  0  0 ]
                       [         ]
(%o9)                  [ 0  0  0 ]
                       [         ]
                       [ 0  0  0 ]

Antes de hacer uso de esta función ejecútese load("cholesky").


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by root on noviembre, 10 2006 using texi2html 1.76.