SlideShare une entreprise Scribd logo
1  sur  24
Matrix Factorization

       Lecture #7
        EEE 574
   Dr. Dan Tylavsky
© Copyright 1999 Daniel Tylavsky
     Matrix Factorization
Let’s look at solving Ax=b
    A, b are dense.
Two possible (general approaches):
– Indirect Methods - methods which asymptotically approach (but never reach) the true solution as the number of steps increases.
         Ex: Point Jacobi, Gauss-Siedel, Successive Over relaxation, Multigrid
–
     •
© Copyright 1999 Daniel Tylavsky
          Matrix Factorization
    Direct Methods - methods that yield the theoretically exact result in a fixed number of steps. (Assuming an infinitely precise computing engine.)
         Ex: Elimination Methods
            Gauss Elimination
            Gauss-Jordan Elimination
–           Cholesky Factorization (Numerically Symmetric)
     •
          – LU or LDU factorization (a.k.a., Product form of the Inverse),(Variations Include Crout, Doolittle, Banachiewicz)
          –
         Orthogonalization Methods
          –
            QR factorization
          –
            Given Rotations
     •
           –
           –
© Copyright 1999 Daniel Tylavsky
     Matrix Factorization
    Conjugate Gradient Methods - Exact solution in # of steps equal to the number of different eigenvalues.
        Various Variations

Advantages of Elimination Methods
  •
       –
  No convergence criteria (however, pivoting in general non-positive definite case.)
  Factors can be used repeatedly.
  Factors can be ‘easily’ modified to accommodate matrix/network changes.
–
  Partial factorized matrices give linear network equivalents.
–
–
–
© Copyright 1999 Daniel Tylavsky
Matrix Factorization
    Definitions
–      Symmetric: A=AT
     • Positive Definite: xTAx>0, (A>0 is short hand notation)
     • Diagonally Dominant:
     •




                                                                      aii ≥   ∑a
                                                                              j ≠i
                                                                                     ,with inequality for at least one i.
                                                                                      ij



                           • Properly Diagonally Dominant: aii >                               ∑a
                                                                                                j ≠i
                                                                                                       ij   for all i.
               • Rank: Order of the largest sub-matrix with nonzero determinant.
© Copyright 1999 Daniel Tylavsky
               Matrix Factorization
    Properties
–      Symmetric pos. def. (A>0) matrix has all positive real eigenvalues.
     • If A>0, then Det(A)=|A|>0.
     • A rank 1 matrix must have the outer-product form, xyT.
     •




                                        1                                            2 4 6 
                                    x =  2  , y T = [ 2 4 6]
                                                                              xy T = 4 8 12
                                                                                              
                                         3
                                                                                     6 12 18
                                                                                              
             • Symmetric A>0 has a unique Cholesky factorization. A=U U, A=U’ DU’
                                                                           T         T


             • If A is properly diagonally dominant and all of its diagonal elements are positive, then A is positive definite.
© Copyright 1999 Daniel Tylavsky
  Matrix Factorization
 – Factorizing a non-symmetric matrix.
     a11    a12    a13       a1n 
    a       a 22   a 23      a2n 
     21                             α bT 
A =  a31    a32    a33       a3 n  =  1 ~ 
                                            1
                                    c    A1 
                              1        
     a n1   an 2   a n3      ann 
                                   
  – I claim A can be expanded in the following form:
           α1 0 1       0 1  b1
                                   T     
         A=                         α1  = L1 A 2U 1
            c1 I  0
                         A2  0
                                   I  
© Copyright 1999 Daniel Tylavsky
Matrix Factorization
– To find the value of A2, multiply.
     α1 0 1           0 1  b1
                                 T     
   A=                             α1  = L1 A 2U 1
      c1 I  0
                       A2  0
                                 I  

                    b1
                      T      α1                 T
                                                 b1         
     α1      0 1                                            α1 b1 
                                                                   T
   A=                 α1  =                           =
                                                             c1 A1 
                                                    T
                                                c1b1             ~
      c1     A2  0   I   c1          A2 +                       
                                                      α1         
                                               Outer product term of
– Therefore:                                  first row & first column
              T          ~                  T
                                       ~ c1b1 (absent. diag. element)
           c1b1
  ∴ A2 +               = A1     ⇒ A2 = A1 −
                  α1                          α         1
© Copyright 1999 Daniel Tylavsky
    Matrix Factorization
– Do this repeatedly until we have the product form of A.


                                       1    0T 
                       1 0           
                                        T
                                                T
                             U 1 = L1 0 α 2 b2 U 1
             2
     A = L1 A U 1 = L1 
                       0 A2 
                                             ~
                                       
                                         c2 A2 


          1 0             0  1 0
                             T
                                                    0 T  1 0 0T  1 0  0T 
                           T=
                                                                               
                                                      T       T
                                                                          T
    A 2 = 0 α 2                                                         b2
                           b2  0 α 2              0  0 1 0  0 1        α2 
                           ~  
           0 c2
                          A2   0 c2               I  0 0 A3  0 0
                                                                        I 
                                                                                


                                   =             L2          A3               U2
© Copyright 1999 Daniel Tylavsky
 Matrix Factorization
– To find A3, multiply the result.
      1 0     0T   1 0 0T  1 0     0T 
                                   T
                                       b2     
A 2 = 0 α 2     T         T
               0  0 1 0  0 1                = L2 A3U 2
                                           α2 
       0 c2
               I  0 0 A3  0 0
                                      I 
                                              

     1 0 0T  1 0         0T  1 0                 0T      
                                                          
                 T
                           T
                          b2
                                  = 0 α 2
                                                       T
   = 0 α 2 0  0 1                                  b2      
                              α2 
      0 c2 A3  0 0
                  
                                     
                             I   0 c2 A3 + c2 b2
                                                         T    
                                                          α2 
                                                              
             T         ~            ~ c b    T
         c b
  ∴ A3 + 2 2        = A2   ⇒ A3 = A2 − 2 2
               α2                               α2
  – We can write:
     A = L1 L2 A3U 2U1
© Copyright 1999 Daniel Tylavsky
Matrix Factorization
– Continuing on yields:
 A = L1 L2  Ln −1 A nU n −1 U 2U 1

– where:
      1          
        0       
 An =            =L
                     n
        0 1      
              n 
            a nn 

– We can write:
 A = L1 L2  Ln −1 LnU n −1 U 2U1
Elementary-Matrix-Multiplication-Superposition Principal.


–



                                                                        © Copyright 1999 Daniel Tylavsky
                         Matrix Factorization
                                i j
                                      1
                                                                             i j
                                                                                             
                                           1                                              
                                                                                        
                                                                            1             ←i
                                              αi                                          
                                  Li L j =                                      αj         ← j ,i < j
                                                               1                     1    
                                              ci                                         
                                                                                cj      
                                           
                                                                   1 
                                                                     
                                                                                           1
                                                                                             
                                                                           1                 
                                                                                            
                                                                                             
                                                                              αi             ←i
                                                                                             
                                                                  Li L j =       αj           ← j ,i < j
                                                                                        1    
                                                                                             
                                                                              ci c j       
                                                                                            1
                                                                                             
© Copyright 1999 Daniel Tylavsky
                                Matrix Factorization
    This implies I can write:


–




                                                   α1                 
                                                       α2             
                                                                      
                                                          α3          
                                                                      
                                L1 L2  Ln −1 Ln =  c1               =L
                                                       c2            
                                                                      
                                                          c3         
                                                                   αn 
                                                                      
© Copyright 1999 Daniel Tylavsky
                             Matrix Factorization
    Taking the transpose of the elementary-matrix- multiplication-superposition principal allows me to write:


–




                                                                       T
                                                                       b1                                                                 
                                                                 1       α1                                                              
                                                                             T                                                           
                                                                  1         b2                                                           
                                                                               α2                                                        
                                                                                                                                   T
                                                                                                                                   b3     
                                         U n −1U n − 2 U 2U 1 =    1
                                                                                                                                      α3  = U
                                                                                                                                        
                                                                                                                                         
                                                                                                                                        
                                                                    1                                                                   
                                                                                                                                         
                                                                 
                                                                                                                                        1
                                                                                                                                          
    Hence we can write:


–
                                                                                                                A = LU
© Copyright 1999 Daniel Tylavsky
                           Matrix Factorization
    Let’s work though an example:


–




                                       10.000 -1.000 -2.000 -3.000
                                       -1.000 12.100 -2.200 -2.700
                                    A= -2.000 -2.200 15.880 -6.300
                                       -3.000 -2.700 -6.300 23.400
                       Divide Top Row by a11.
                  –

                                                               T
                                                          ~ c1b1        Divide 3rd Row by α3.
                               – Compute             A2 = A1 −
                                                                    –

                                                                    α1
                       Divide 2nd Row by α2.
                  –                                                                                           T
                                                                                                         ~ c3b3
                                                                T
                                                          ~ c2 b2
                                                                           – Compute                A4 = A3 −
                                                                                                                  α3
                               – Compute             A3 = A2 −
                                                                    α2
                       10.000                      0      0      0
                                                                 0
                                                 0.000 0.000 0.000     1.000
                                                                       1.000                    -0.100 -0.200 -0.300
                                                                                                 -0.100 -0.200 -0.300
                                                                                                -0.100 -0.200 -0.300
                       -1.000                   12.000 -2.400 -3.400
                                                          0      0
                                                12.100 -2.200 -2.700
                                                              -3.000     00                        1
                                                                                                   11     0      0
                                                                                                        -0.200 -0.250
                                                                                                        -0.200 -0.250
                                                                                                           0      0
                    A= -2.000                   -2.400 15.480 -6.900 *
                                                -2.200 15.880 -6.300 *
                                                       15.000 -7.500
                                                                 0       00                        0
                                                                                                   00     11
                                                                                                           1     0
                                                                                                               -0.500
                                                                                                               -0.500
                                                                                                                  0
                       -3.000                   -3.000 -6.900 22.500
                                                -2.700 -6.300 23.400
                                                       -7.500 21.750
                                                              18.000     00                        0
                                                                                                   00     00
                                                                                                           0     11
                                                                                                                  1
© Copyright 1999 Daniel Tylavsky
Matrix Factorization
Individual Problem: Verify that previous answer is correct.



   10.000          0          0         0           1.000     -0.100   -0.200   -0.300
   -1.000       12.000        0         0             0          1     -0.200   -0.250
A= -2.000       -2.400     15.000       0    *        0          0        1     -0.500
   -3.000       -3.000     -7.500     18.000          0          0        0        1

Individual Problem: Factor A=LU for:
         20.000 -20.000 -8.000 -8.000
         -20.000 40.000 3.000 3.000
      A= -8.000 3.000 14.450 -5.550
          -8.000 3.000 -5.550 24.450

Note that result isn’t symmetrical.
© Copyright 1999 Daniel Tylavsky
    Matrix Factorization
    To make this symmetric use the L’DL’T form.
    – Let
               l11                              – Write:
                   l 22                        
                                                  A = LD −1 DU = L' DL'T
            D=
                                   l33         
                                               
                                          l 44 
     10.000      0        0       0         1.000    -0.100        -0.200    -0.300
     -1.000   12.000      0       0           0         1          -0.200    -0.250
  A= -2.000   -2.400   15.000     0    *      0         0             1      -0.500
     -3.000   -3.000   -7.500   18.000        0         0             0         1

        1        0        0     0          10       0         0         0        1.000   -0.100   -0.200   -0.300
     -0.100      1        0     0          0        12        0         0          0        1     -0.200   -0.250
  A= -0.200   -0.200      1     0    *     0        0         15        0      * 0          0        1     -0.500
     -0.300   -0.250   -0.500   1          0        0         0         18         0        0        0        1

– Division by diag. of row & col. Performed @ same time.
© Copyright 1999 Daniel Tylavsky
Matrix Factorization
Individual Problem: Modify LU factors of A:

           20.000 -20.000 -8.000 -8.000
          -20.000 40.000 3.000 3.000
       A= -8.000 3.000 14.450 -5.550
           -8.000 3.000 -5.550 24.450

To get L’DL’T:
© Copyright 1999 Daniel Tylavsky
Matrix Factorization
Data structure for storing LU factors?

   10.000      0         0       0         1.000   -0.100   -0.200   -0.300
   -1.000   12.000       0       0           0        1     -0.200   -0.250
A= -2.000   -2.400    15.000     0    *      0        0        1     -0.500
   -3.000   -3.000    -7.500   18.000        0        0        0        1
 For LU factors could use LC-D-UR/X:

    Pos:     0        1    2     3   4    5    6               7       8      9   10   11   12
DiagL(k)             10.0 12 15 18
   U(k):             -0.1 -0.2 -0.3 -0.2 -0.3 -0.5
    L(k):            -1.0 -2.0 -3.0 -2.4 -3.0 -7.5
 Indx(k):             2    3     4   3    4    4
 ERP(k):     0        3    5     6
© Copyright 1999 Daniel Tylavsky
  Matrix Factorization
      1        0         0     0       10       0    0        0     1.000   -0.100   -0.200   -0.300
   -0.100      1         0     0       0       12    0        0       0        1     -0.200   -0.250
A= -0.200   -0.200       1     0   *   0        0   15        0   * 0          0        1     -0.500
   -0.300   -0.250    -0.500   1       0        0    0       18       0        0        0        1

For L’DL’T factors could use CR(L)-D/X:

    Pos:     0         1   2     3   4     5   6         7        8     9     10     11       12
 Diag(k)             10.0 12 15 18
    L(k):            -0.1 -0.2 -0.3 -0.2 -0.3 -0.5
RIndx(k):              2   3     4   3     4   4
 ERP(k):     0         3   5     6
© Copyright 1999 Daniel Tylavsky
                              Matrix Factorization
    If we store & work through A by rows, factorization is done in a slightly different way:


–




                                                                                                                          10.000    -1.000    -2.000    -3.000
                                                                                                                          -1.000    12.100    -2.200    -2.700
                                                                                                                       A= -2.000    -2.200    15.880    -6.300
                   –
                         Divide Top Row by a11.                                                                           -3.000    -2.700    -6.300    23.400
                                                                                                                  T
                                                                                                             ~ c1b1
                                  – Compute                                                             A2 = A1 −
                                                                                                                      α1 for   2nd row.
                         Divide 2nd Row by α2.
                   –
                                                                                                             T
                                                                                                        ~ c1b1                           T
                                                                                                                                   ~ c2 b2
                                  – Compute                                                        A2 = A1 −
                                                                                                                    α1and     A3 = A2 −        for
                                                                                                                                              α2       3rd row.
                         10.000                                                                   0         0         0         1    -0.100    -0.200    -0.300
                         -1.000                                                                12.000
                                                                                               12.100       0
                                                                                                         -2.400
                                                                                                         -2.200       0
                                                                                                                   -3.000
                                                                                                                   -2.700       0       1      -0.200
                                                                                                                                                  0      -0.250
                                                                                                                                                            0
                      A= -2.000                                                                -2.400
                                                                                               -2.200    15.000
                                                                                                         15.880    -7.500
                                                                                                                   -6.300 *     0       0         1         0
                         -3.000                                                                -2.700    -6.300    23.400       0       0         0         1
© Copyright 1999 Daniel Tylavsky
 Matrix Factorization
Individual Problem: Finish the factorization.

   10.000        0         0         0          1   -0.100   -0.200   -0.300
   -1.000     12.000       0         0          0      1     -0.200   -0.250
A= -2.000     -2.400    15.000    -7.500 *      0      0        1        0
   -3.000     -2.700    -6.300    23.400        0      0        0        1
© Copyright 1999 Daniel Tylavsky
 Matrix Factorization
 – Cholesky Factorization (Symmetric A=LLT.)
     a11   a12    a13         a1n 
    a      a 22   a 23        a2n 
     12                              α bT 
A =  a13   a 23   a33         a 3n  =  1 ~ 
                                             1
                                      b A1 
                               1       
    a1n    a2n    a3 n        a nn 
                                    
  – A can be expanded in the following form:
       α1         0 1                T
                                        b1       
                            0   α1
  A =  b1           
                                              α1  = L1 A L1
                                                         2 T
                                                               Etc.
                  I  0   A2                 
      
          α1        
                     
                                0
                                            I  
  – Not used. Calculating square-roots is expensive.
The End

Contenu connexe

Tendances

Lesson 14: Derivatives of Logarithmic and Exponential Functions
Lesson 14: Derivatives of Logarithmic and Exponential FunctionsLesson 14: Derivatives of Logarithmic and Exponential Functions
Lesson 14: Derivatives of Logarithmic and Exponential Functions
Matthew Leingang
 
Lecture on solving1
Lecture on solving1Lecture on solving1
Lecture on solving1
NBER
 
Exponentials integrals
Exponentials integralsExponentials integrals
Exponentials integrals
Tarun Gehlot
 
7.digital basicsa
7.digital basicsa7.digital basicsa
7.digital basicsa
Chethan Nt
 
Lesson 16: Inverse Trigonometric Functions
Lesson 16: Inverse Trigonometric FunctionsLesson 16: Inverse Trigonometric Functions
Lesson 16: Inverse Trigonometric Functions
Matthew Leingang
 
11.solution of linear and nonlinear partial differential equations using mixt...
11.solution of linear and nonlinear partial differential equations using mixt...11.solution of linear and nonlinear partial differential equations using mixt...
11.solution of linear and nonlinear partial differential equations using mixt...
Alexander Decker
 
addmaths-gantt-chart-f4-and-5
addmaths-gantt-chart-f4-and-5addmaths-gantt-chart-f4-and-5
addmaths-gantt-chart-f4-and-5
suefee
 
Optimalpolicyhandout
OptimalpolicyhandoutOptimalpolicyhandout
Optimalpolicyhandout
NBER
 
Chapter 3 projection
Chapter 3 projectionChapter 3 projection
Chapter 3 projection
NBER
 

Tendances (20)

Models
ModelsModels
Models
 
Rouviere
RouviereRouviere
Rouviere
 
Lesson 14: Derivatives of Logarithmic and Exponential Functions
Lesson 14: Derivatives of Logarithmic and Exponential FunctionsLesson 14: Derivatives of Logarithmic and Exponential Functions
Lesson 14: Derivatives of Logarithmic and Exponential Functions
 
Lecture on solving1
Lecture on solving1Lecture on solving1
Lecture on solving1
 
Exponentials integrals
Exponentials integralsExponentials integrals
Exponentials integrals
 
7.digital basicsa
7.digital basicsa7.digital basicsa
7.digital basicsa
 
Chapter 1 straight line
Chapter 1 straight lineChapter 1 straight line
Chapter 1 straight line
 
Peta karnaugh
Peta karnaughPeta karnaugh
Peta karnaugh
 
Lesson 16: Inverse Trigonometric Functions
Lesson 16: Inverse Trigonometric FunctionsLesson 16: Inverse Trigonometric Functions
Lesson 16: Inverse Trigonometric Functions
 
Solution of linear and nonlinear partial differential equations using mixture...
Solution of linear and nonlinear partial differential equations using mixture...Solution of linear and nonlinear partial differential equations using mixture...
Solution of linear and nonlinear partial differential equations using mixture...
 
11.solution of linear and nonlinear partial differential equations using mixt...
11.solution of linear and nonlinear partial differential equations using mixt...11.solution of linear and nonlinear partial differential equations using mixt...
11.solution of linear and nonlinear partial differential equations using mixt...
 
addmaths-gantt-chart-f4-and-5
addmaths-gantt-chart-f4-and-5addmaths-gantt-chart-f4-and-5
addmaths-gantt-chart-f4-and-5
 
Statistics lecture 13 (chapter 13)
Statistics lecture 13 (chapter 13)Statistics lecture 13 (chapter 13)
Statistics lecture 13 (chapter 13)
 
Geometry Section 3-4 1112
Geometry Section 3-4 1112Geometry Section 3-4 1112
Geometry Section 3-4 1112
 
Iskmaa
IskmaaIskmaa
Iskmaa
 
Session 20
Session 20Session 20
Session 20
 
Linear (in)dependence
Linear (in)dependenceLinear (in)dependence
Linear (in)dependence
 
Optimalpolicyhandout
OptimalpolicyhandoutOptimalpolicyhandout
Optimalpolicyhandout
 
Chapter 3 projection
Chapter 3 projectionChapter 3 projection
Chapter 3 projection
 
Doclad Ulm 2008
Doclad Ulm 2008Doclad Ulm 2008
Doclad Ulm 2008
 

En vedette

Lecture 6 lu factorization & determinants - section 2-5 2-7 3-1 and 3-2
Lecture 6   lu factorization & determinants - section 2-5 2-7 3-1 and 3-2Lecture 6   lu factorization & determinants - section 2-5 2-7 3-1 and 3-2
Lecture 6 lu factorization & determinants - section 2-5 2-7 3-1 and 3-2
njit-ronbrown
 
Recommender system introduction
Recommender system   introductionRecommender system   introduction
Recommender system introduction
Liang Xiang
 
Factorization Machines with libFM
Factorization Machines with libFMFactorization Machines with libFM
Factorization Machines with libFM
Liangjie Hong
 
Building a Recommendation Engine - An example of a product recommendation engine
Building a Recommendation Engine - An example of a product recommendation engineBuilding a Recommendation Engine - An example of a product recommendation engine
Building a Recommendation Engine - An example of a product recommendation engine
NYC Predictive Analytics
 
Recommender system algorithm and architecture
Recommender system algorithm and architectureRecommender system algorithm and architecture
Recommender system algorithm and architecture
Liang Xiang
 

En vedette (17)

Intro to Factorization Machines
Intro to Factorization MachinesIntro to Factorization Machines
Intro to Factorization Machines
 
آموزش محاسبات عددی - بخش دوم
آموزش محاسبات عددی - بخش دومآموزش محاسبات عددی - بخش دوم
آموزش محاسبات عددی - بخش دوم
 
Matrix Factorization Technique for Recommender Systems
Matrix Factorization Technique for Recommender SystemsMatrix Factorization Technique for Recommender Systems
Matrix Factorization Technique for Recommender Systems
 
Neighbor methods vs matrix factorization - case studies of real-life recommen...
Neighbor methods vs matrix factorization - case studies of real-life recommen...Neighbor methods vs matrix factorization - case studies of real-life recommen...
Neighbor methods vs matrix factorization - case studies of real-life recommen...
 
Nonnegative Matrix Factorization
Nonnegative Matrix FactorizationNonnegative Matrix Factorization
Nonnegative Matrix Factorization
 
Collaborative Filtering with Spark
Collaborative Filtering with SparkCollaborative Filtering with Spark
Collaborative Filtering with Spark
 
Lecture 6 lu factorization & determinants - section 2-5 2-7 3-1 and 3-2
Lecture 6   lu factorization & determinants - section 2-5 2-7 3-1 and 3-2Lecture 6   lu factorization & determinants - section 2-5 2-7 3-1 and 3-2
Lecture 6 lu factorization & determinants - section 2-5 2-7 3-1 and 3-2
 
Recommender system introduction
Recommender system   introductionRecommender system   introduction
Recommender system introduction
 
Factorization Machines with libFM
Factorization Machines with libFMFactorization Machines with libFM
Factorization Machines with libFM
 
Introduction to Matrix Factorization Methods Collaborative Filtering
Introduction to Matrix Factorization Methods Collaborative FilteringIntroduction to Matrix Factorization Methods Collaborative Filtering
Introduction to Matrix Factorization Methods Collaborative Filtering
 
Recommender Systems
Recommender SystemsRecommender Systems
Recommender Systems
 
Beginners Guide to Non-Negative Matrix Factorization
Beginners Guide to Non-Negative Matrix FactorizationBeginners Guide to Non-Negative Matrix Factorization
Beginners Guide to Non-Negative Matrix Factorization
 
Recommendation system
Recommendation system Recommendation system
Recommendation system
 
Recommender Systems
Recommender SystemsRecommender Systems
Recommender Systems
 
Collaborative Filtering Recommendation System
Collaborative Filtering Recommendation SystemCollaborative Filtering Recommendation System
Collaborative Filtering Recommendation System
 
Building a Recommendation Engine - An example of a product recommendation engine
Building a Recommendation Engine - An example of a product recommendation engineBuilding a Recommendation Engine - An example of a product recommendation engine
Building a Recommendation Engine - An example of a product recommendation engine
 
Recommender system algorithm and architecture
Recommender system algorithm and architectureRecommender system algorithm and architecture
Recommender system algorithm and architecture
 

Similaire à Matrix factorization (9)

งานนำเสนอMatrix
งานนำเสนอMatrixงานนำเสนอMatrix
งานนำเสนอMatrix
 
งานนำเสนอMatrixของจริง
งานนำเสนอMatrixของจริงงานนำเสนอMatrixของจริง
งานนำเสนอMatrixของจริง
 
Fatigue damage in solder joint interconnects - presentation
Fatigue damage in solder joint interconnects - presentationFatigue damage in solder joint interconnects - presentation
Fatigue damage in solder joint interconnects - presentation
 
Mo u quantified
Mo u   quantifiedMo u   quantified
Mo u quantified
 
mechanic of machine-Mechanical Vibrations
mechanic of machine-Mechanical Vibrationsmechanic of machine-Mechanical Vibrations
mechanic of machine-Mechanical Vibrations
 
Session 2
Session 2Session 2
Session 2
 
Linear Transformations_part1.pdf
Linear Transformations_part1.pdfLinear Transformations_part1.pdf
Linear Transformations_part1.pdf
 
Parameter Estimation in Stochastic Differential Equations by Continuous Optim...
Parameter Estimation in Stochastic Differential Equations by Continuous Optim...Parameter Estimation in Stochastic Differential Equations by Continuous Optim...
Parameter Estimation in Stochastic Differential Equations by Continuous Optim...
 
Chapter9 trignometry
Chapter9 trignometryChapter9 trignometry
Chapter9 trignometry
 

Dernier

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Dernier (20)

HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 

Matrix factorization

  • 1. Matrix Factorization Lecture #7 EEE 574 Dr. Dan Tylavsky
  • 2. © Copyright 1999 Daniel Tylavsky Matrix Factorization Let’s look at solving Ax=b A, b are dense. Two possible (general approaches): – Indirect Methods - methods which asymptotically approach (but never reach) the true solution as the number of steps increases. Ex: Point Jacobi, Gauss-Siedel, Successive Over relaxation, Multigrid – •
  • 3. © Copyright 1999 Daniel Tylavsky Matrix Factorization Direct Methods - methods that yield the theoretically exact result in a fixed number of steps. (Assuming an infinitely precise computing engine.) Ex: Elimination Methods Gauss Elimination Gauss-Jordan Elimination – Cholesky Factorization (Numerically Symmetric) • – LU or LDU factorization (a.k.a., Product form of the Inverse),(Variations Include Crout, Doolittle, Banachiewicz) – Orthogonalization Methods – QR factorization – Given Rotations • – –
  • 4. © Copyright 1999 Daniel Tylavsky Matrix Factorization Conjugate Gradient Methods - Exact solution in # of steps equal to the number of different eigenvalues. Various Variations Advantages of Elimination Methods • – No convergence criteria (however, pivoting in general non-positive definite case.) Factors can be used repeatedly. Factors can be ‘easily’ modified to accommodate matrix/network changes. – Partial factorized matrices give linear network equivalents. – – –
  • 5. © Copyright 1999 Daniel Tylavsky Matrix Factorization Definitions – Symmetric: A=AT • Positive Definite: xTAx>0, (A>0 is short hand notation) • Diagonally Dominant: • aii ≥ ∑a j ≠i ,with inequality for at least one i. ij • Properly Diagonally Dominant: aii > ∑a j ≠i ij for all i. • Rank: Order of the largest sub-matrix with nonzero determinant.
  • 6. © Copyright 1999 Daniel Tylavsky Matrix Factorization Properties – Symmetric pos. def. (A>0) matrix has all positive real eigenvalues. • If A>0, then Det(A)=|A|>0. • A rank 1 matrix must have the outer-product form, xyT. • 1  2 4 6  x =  2  , y T = [ 2 4 6]   xy T = 4 8 12    3   6 12 18   • Symmetric A>0 has a unique Cholesky factorization. A=U U, A=U’ DU’ T T • If A is properly diagonally dominant and all of its diagonal elements are positive, then A is positive definite.
  • 7. © Copyright 1999 Daniel Tylavsky Matrix Factorization – Factorizing a non-symmetric matrix.  a11 a12 a13  a1n  a a 22 a 23  a2n   21  α bT  A =  a31 a32 a33  a3 n  =  1 ~  1   c A1          1   a n1 an 2 a n3  ann    – I claim A can be expanded in the following form: α1 0 1 0 1  b1 T  A=  α1  = L1 A 2U 1  c1 I  0  A2  0  I  
  • 8. © Copyright 1999 Daniel Tylavsky Matrix Factorization – To find the value of A2, multiply. α1 0 1 0 1  b1 T  A=  α1  = L1 A 2U 1  c1 I  0  A2  0  I    b1 T  α1 T b1   α1 0 1 α1 b1  T A=  α1  =  =   c1 A1  T  c1b1 ~  c1 A2  0 I   c1 A2 +    α1    Outer product term of – Therefore: first row & first column T ~ T ~ c1b1 (absent. diag. element) c1b1 ∴ A2 + = A1 ⇒ A2 = A1 − α1 α 1
  • 9. © Copyright 1999 Daniel Tylavsky Matrix Factorization – Do this repeatedly until we have the product form of A. 1 0T  1 0   T T U 1 = L1 0 α 2 b2 U 1 2 A = L1 A U 1 = L1  0 A2    ~   c2 A2  1 0 0  1 0 T 0 T  1 0 0T  1 0 0T   T=   T  T T A 2 = 0 α 2 b2 b2  0 α 2 0  0 1 0  0 1 α2  ~    0 c2  A2   0 c2 I  0 0 A3  0 0   I   = L2 A3 U2
  • 10. © Copyright 1999 Daniel Tylavsky Matrix Factorization – To find A3, multiply the result. 1 0 0T  1 0 0T  1 0 0T     T b2  A 2 = 0 α 2 T T 0  0 1 0  0 1 = L2 A3U 2 α2   0 c2  I  0 0 A3  0 0   I   1 0 0T  1 0 0T  1 0 0T       T T b2  = 0 α 2 T = 0 α 2 0  0 1 b2  α2   0 c2 A3  0 0    I   0 c2 A3 + c2 b2 T   α2   T ~ ~ c b T c b ∴ A3 + 2 2 = A2 ⇒ A3 = A2 − 2 2 α2 α2 – We can write: A = L1 L2 A3U 2U1
  • 11. © Copyright 1999 Daniel Tylavsky Matrix Factorization – Continuing on yields: A = L1 L2  Ln −1 A nU n −1 U 2U 1 – where: 1    0  An =  =L n  0 1   n   a nn  – We can write: A = L1 L2  Ln −1 LnU n −1 U 2U1
  • 12. Elementary-Matrix-Multiplication-Superposition Principal. – © Copyright 1999 Daniel Tylavsky Matrix Factorization i j 1 i j  1          1 ←i  αi   Li L j =   αj  ← j ,i < j  1  1   ci      cj     1    1  1        αi ←i   Li L j =  αj  ← j ,i < j  1     ci c j    1  
  • 13. © Copyright 1999 Daniel Tylavsky Matrix Factorization This implies I can write: – α1   α2     α3    L1 L2  Ln −1 Ln =  c1  =L  c2      c3    αn   
  • 14. © Copyright 1999 Daniel Tylavsky Matrix Factorization Taking the transpose of the elementary-matrix- multiplication-superposition principal allows me to write: –  T b1  1 α1   T   1 b2   α2   T b3  U n −1U n − 2 U 2U 1 =  1 α3  = U          1       1  Hence we can write: – A = LU
  • 15. © Copyright 1999 Daniel Tylavsky Matrix Factorization Let’s work though an example: – 10.000 -1.000 -2.000 -3.000 -1.000 12.100 -2.200 -2.700 A= -2.000 -2.200 15.880 -6.300 -3.000 -2.700 -6.300 23.400 Divide Top Row by a11. – T ~ c1b1 Divide 3rd Row by α3. – Compute A2 = A1 − – α1 Divide 2nd Row by α2. – T ~ c3b3 T ~ c2 b2 – Compute A4 = A3 − α3 – Compute A3 = A2 − α2 10.000 0 0 0 0 0.000 0.000 0.000 1.000 1.000 -0.100 -0.200 -0.300 -0.100 -0.200 -0.300 -0.100 -0.200 -0.300 -1.000 12.000 -2.400 -3.400 0 0 12.100 -2.200 -2.700 -3.000 00 1 11 0 0 -0.200 -0.250 -0.200 -0.250 0 0 A= -2.000 -2.400 15.480 -6.900 * -2.200 15.880 -6.300 * 15.000 -7.500 0 00 0 00 11 1 0 -0.500 -0.500 0 -3.000 -3.000 -6.900 22.500 -2.700 -6.300 23.400 -7.500 21.750 18.000 00 0 00 00 0 11 1
  • 16. © Copyright 1999 Daniel Tylavsky Matrix Factorization Individual Problem: Verify that previous answer is correct. 10.000 0 0 0 1.000 -0.100 -0.200 -0.300 -1.000 12.000 0 0 0 1 -0.200 -0.250 A= -2.000 -2.400 15.000 0 * 0 0 1 -0.500 -3.000 -3.000 -7.500 18.000 0 0 0 1 Individual Problem: Factor A=LU for: 20.000 -20.000 -8.000 -8.000 -20.000 40.000 3.000 3.000 A= -8.000 3.000 14.450 -5.550 -8.000 3.000 -5.550 24.450 Note that result isn’t symmetrical.
  • 17. © Copyright 1999 Daniel Tylavsky Matrix Factorization To make this symmetric use the L’DL’T form. – Let l11  – Write:  l 22    A = LD −1 DU = L' DL'T D=  l33     l 44  10.000 0 0 0 1.000 -0.100 -0.200 -0.300 -1.000 12.000 0 0 0 1 -0.200 -0.250 A= -2.000 -2.400 15.000 0 * 0 0 1 -0.500 -3.000 -3.000 -7.500 18.000 0 0 0 1 1 0 0 0 10 0 0 0 1.000 -0.100 -0.200 -0.300 -0.100 1 0 0 0 12 0 0 0 1 -0.200 -0.250 A= -0.200 -0.200 1 0 * 0 0 15 0 * 0 0 1 -0.500 -0.300 -0.250 -0.500 1 0 0 0 18 0 0 0 1 – Division by diag. of row & col. Performed @ same time.
  • 18. © Copyright 1999 Daniel Tylavsky Matrix Factorization Individual Problem: Modify LU factors of A: 20.000 -20.000 -8.000 -8.000 -20.000 40.000 3.000 3.000 A= -8.000 3.000 14.450 -5.550 -8.000 3.000 -5.550 24.450 To get L’DL’T:
  • 19. © Copyright 1999 Daniel Tylavsky Matrix Factorization Data structure for storing LU factors? 10.000 0 0 0 1.000 -0.100 -0.200 -0.300 -1.000 12.000 0 0 0 1 -0.200 -0.250 A= -2.000 -2.400 15.000 0 * 0 0 1 -0.500 -3.000 -3.000 -7.500 18.000 0 0 0 1 For LU factors could use LC-D-UR/X: Pos: 0 1 2 3 4 5 6 7 8 9 10 11 12 DiagL(k) 10.0 12 15 18 U(k): -0.1 -0.2 -0.3 -0.2 -0.3 -0.5 L(k): -1.0 -2.0 -3.0 -2.4 -3.0 -7.5 Indx(k): 2 3 4 3 4 4 ERP(k): 0 3 5 6
  • 20. © Copyright 1999 Daniel Tylavsky Matrix Factorization 1 0 0 0 10 0 0 0 1.000 -0.100 -0.200 -0.300 -0.100 1 0 0 0 12 0 0 0 1 -0.200 -0.250 A= -0.200 -0.200 1 0 * 0 0 15 0 * 0 0 1 -0.500 -0.300 -0.250 -0.500 1 0 0 0 18 0 0 0 1 For L’DL’T factors could use CR(L)-D/X: Pos: 0 1 2 3 4 5 6 7 8 9 10 11 12 Diag(k) 10.0 12 15 18 L(k): -0.1 -0.2 -0.3 -0.2 -0.3 -0.5 RIndx(k): 2 3 4 3 4 4 ERP(k): 0 3 5 6
  • 21. © Copyright 1999 Daniel Tylavsky Matrix Factorization If we store & work through A by rows, factorization is done in a slightly different way: – 10.000 -1.000 -2.000 -3.000 -1.000 12.100 -2.200 -2.700 A= -2.000 -2.200 15.880 -6.300 – Divide Top Row by a11. -3.000 -2.700 -6.300 23.400 T ~ c1b1 – Compute A2 = A1 − α1 for 2nd row. Divide 2nd Row by α2. – T ~ c1b1 T ~ c2 b2 – Compute A2 = A1 − α1and A3 = A2 − for α2 3rd row. 10.000 0 0 0 1 -0.100 -0.200 -0.300 -1.000 12.000 12.100 0 -2.400 -2.200 0 -3.000 -2.700 0 1 -0.200 0 -0.250 0 A= -2.000 -2.400 -2.200 15.000 15.880 -7.500 -6.300 * 0 0 1 0 -3.000 -2.700 -6.300 23.400 0 0 0 1
  • 22. © Copyright 1999 Daniel Tylavsky Matrix Factorization Individual Problem: Finish the factorization. 10.000 0 0 0 1 -0.100 -0.200 -0.300 -1.000 12.000 0 0 0 1 -0.200 -0.250 A= -2.000 -2.400 15.000 -7.500 * 0 0 1 0 -3.000 -2.700 -6.300 23.400 0 0 0 1
  • 23. © Copyright 1999 Daniel Tylavsky Matrix Factorization – Cholesky Factorization (Symmetric A=LLT.)  a11 a12 a13  a1n  a a 22 a 23  a2n   12  α bT  A =  a13 a 23 a33  a 3n  =  1 ~  1    b A1          1  a1n a2n a3 n  a nn    – A can be expanded in the following form:  α1 0 1  T b1  0   α1 A =  b1  α1  = L1 A L1 2 T Etc.  I  0 A2      α1    0  I   – Not used. Calculating square-roots is expensive.