Download presentation
Presentation is loading. Please wait.
Published byWinfred Wade Modified over 9 years ago
1
Lecture 3 Matrix algebra A vector can be interpreted as a file of data A matrix is a collection of vectors and can be interpreted as a data base The red matrix contain three column vectors Handling biological data is most easily done with a matrix approach. An Excel worksheet is a matrix.
2
A general structure of databases The first subscript denotes rows, the second columns. n and m define the dimension of a matrix. A has m rows and n columns. Two matrices are equal if they have the same dimension and all corresponding values are identical. Column vector Row vector
3
In biology and statistics are square matrices A n,n of particular importance The symmetric matrix is a matrix where A n,m = A m,n. Lower and upper triangular matrices Some elementary types of matrices The diagonal matrix is a square and symmetrical. Unit matrix I is a matrix with one row and one column. It is a scalar (ordinary number).
4
Matrix operations Addition and Subtraction Addition and subtraction are only defined for matrices with identical dimensions S-product
5
The inner or dot or scalar product Assume you have production data (in tons) of winter wheat (15 t), summer wheat (20 t), and barley (30 t). In the next year weather condition reduced the winter wheat production by 20%, the summer wheat production by 10% and the barley production by 30%. How many tons do you get the next year? (15*0.8 + 20* 0.9 + 30 * 0.7) t = 51 t. The dot product is only defined for matrices, where the number of columns in the first matrix equals the number of rows in the second matrix.
6
We add another year and ask how many cereals we get if the second year is good and gives 10 % more of winter wheat, 20 % more of summer wheat and 25 % more of barley. For both years we start counting with the original data and get a vector with one row that is the result of a two step process
7
Transpose A’ ot A T
8
Matrix add in for Excel: www.digilander.libero.it/foxes/SoftwareDownload.htm
9
Specieswroswronwilterswisosmillip Pterostichus nigrita (Paykull)026153018392 Platynus assimilis (Paykull)0010090117 Amara brunea (Gyllenhal)1100194001 Agonum lugens (Duftshmid)11220000 Loricera pilicornis (Fabricius)00100030 Pterostichus vernalis (Panzer)112120170 Amara plebeja (Gyllenhal)00001204 Badister unipustulatus Bonelli00004103 Lasoitrechus discus (Fabricius)00010010 Poecilus cupreus (Linnaeus)00000200 Amara aulica (Panzer)01000000 Anisodatylus binotatus (Fabricius)00000020 Bembidion articulatum (Panzer)00000010 Clivina collaris (Herbst)00000020 Ground beetles on Mazurian lake islands (Mamry) Photo Marek Ostrowski Carabus auratus Carabus problematicus
10
Specieswroswronwilterswisosmillip Pterostichus nigrita (Paykull)026153018392 Platynus assimilis (Paykull)0010090117 Amara brunea (Gyllenhal)1100194001 Agonum lugens (Duftshmid)11220000 Loricera pilicornis (Fabricius)00100030 Pterostichus vernalis (Panzer)112120170 Amara plebeja (Gyllenhal)00001204 Badister unipustulatus Bonelli00004103 Lasoitrechus discus (Fabricius)00010010 Poecilus cupreus (Linnaeus)00000200 Amara aulica (Panzer)01000000 Anisodatylus binotatus (Fabricius)00000020 Bembidion articulatum (Panzer)00000010 Clivina collaris (Herbst)00000020 Panagaeus cruxmajor (Linnaeus)024001051 Poecilus versicolor (Sturm)00000002 Pterostichus gracilis Dejean)00000000 Stenolophus mixtus00010000 Pseudoophonus rufipes (De Geer)001300532 Harpalus latus (Linnaeus)00000302 Agonum duftshmidi Shmidt00100000 Harpalus solitaris Dejean00001010 Species associations
12
S Panagaeus cruxmajor (Linnaeus) Poecilus versicolor (Sturm) Pterostichus gracilis Dejean) Stenolophus mixtus Pseudoopho nus rufipes (De Geer) Harpalus latus (Linnaeus) Agonum duftshmidi Shmidt Harpalus solitaris Dejean wros00000000 wron240000000 wil000013010 ter00010000 swi10000001 sos00005300 mil50003001 lip12002200 Specieswroswronwilterswisosmillip Pterostichus nigrita (Paykull)026153018392 Platynus assimilis (Paykull)0010090117 Amara brunea (Gyllenhal)1100194001 Agonum lugens (Duftshmid)11220000 Loricera pilicornis (Fabricius)00100030 Pterostichus vernalis (Panzer)112120170 Amara plebeja (Gyllenhal)00001204 Badister unipustulatus Bonelli00004103 Lasoitrechus discus (Fabricius)00010010 Poecilus cupreus (Linnaeus)00000200 Amara aulica (Panzer)01000000 Anisodatylus binotatus (Fabricius)00000020 Bembidion articulatum (Panzer)00000010 Clivina collaris (Herbst)00000020 Species Panagaeus cruxmajor (Linnaeus) Poecilus versicolor (Sturm) Pterostichus gracilis Dejean) Stenolophus mixtus Pseudoopho nus rufipes (De Geer) Harpalus latus (Linnaeus) Agonum duftshmidi Shmidt Harpalus solitaris Dejean Pterostichus nigrita (Paykull)24540531004586139 Platynus assimilis (Paykull)1172340029226110 Amara brunea (Gyllenhal)44200202122019 Agonum lugens (Duftshmid)2400226020 Loricera pilicornis (Fabricius)1500022013 Pterostichus vernalis (Panzer)590022993217 Amara plebeja (Gyllenhal)5800181401 Badister unipustulatus Bonelli760011904 Lasoitrechus discus (Fabricius)50013001 Poecilus cupreus (Linnaeus)000010600 Amara aulica (Panzer)240000000 Anisodatylus binotatus (Fabricius)100006002 Bembidion articulatum (Panzer)50003001 Clivina collaris (Herbst)100006002
13
Assume you are studying a contagious disease. You identified as small group of 4 persons infected by the disease. These 4 persons contacted in a given time with another group of 5 persons. The latter 5 persons had contact with other persons, say with 6, and so on. How often did a person of group C indirectly contact with a person of group A? A 1 2 3 4 B12345B12345 B 1 2 3 4 5 C123456C123456 A 1 2 3 4 C123456C123456 We eliminate group B and leave the first and last group. No. 1 of group C indirectly contacted with all members of group A. No. 2 of group A indirectly contacted with all six persons of group C.
14
Lecture 4 The Gauß scheme A linear system of equations Matrix algebra deals essentially with linear linear systems. Multiplicative elements. A non-linear system Solving simple stoichiometric equations
15
The division through a vector or a matrix is not defined! 2 equations and four unknowns Solving a linear system
16
For a non-singular square matrix the inverse is defined as r 2 =2r 1 r 3 =2r 1 +r 2 Singular matrices are those where some rows or columns can be expressed by a linear combination of others. Such columns or rows do not contain additional information. They are redundant. A linear combination of vectors A matrix is singular if it’s determinant is zero. Det A: determinant of A A matrix is singular if at least one of the parameters k is not zero.
17
(AB) -1 = B -1 A -1 ≠ A -1 B -1 Determinant The inverse of a 2x2 matrixThe inverse of a diagonal matrix The inverse of a square matrix only exists if its determinant differs from zero. Singular matrices do not have an inverse The inverse can be unequivocally calculated by the Gauss-Jordan algorithm The Nine Chapters on the Mathematical Art. (1000BC-100AD). Systems of linear equations, Gaussian elimination
18
Solving a simple linear system
19
Identity matrix Only possible if A is not singular. If A is singular the system has no solution. The general solution of a linear system Systems with a unique solution The number of independent equations equals the number of unknowns. X: Not singularThe augmented matrix X aug is not singular and has the same rank as X. The rank of a matrix is minimum number of rows/columns of the largest non-singular submatrix
20
Consistent Rank(A) = rank(A:B) = n Consistent Rank(A) = rank(A:B) < n Inconsistent Rank(A) < rank(A:B) Consistent Rank(A) = rank(A:B) < n Inconsistent Rank(A) < rank(A:B) Consistent Rank(A) = rank(A:B) = n Infinite number of solutions No solution Infinite number of solutions No solution Infinite number of solutions
21
The transition matrix Assume a gene with four different alleles. Each allele can mutate into anther allele. The mutation probabilities can be measured. A→AB→AC→AD→A Sum 11 1 1 Transition matrix Probability matrix Initial allele frequencies What are the frequencies in the next generation? A→A A→B A→C A→D Σ = 1 The frequencies at time t+1 do only depent on the frequencies at time t but not on earlier ones. Markov process
22
Does the mutation process result in stable allele frequencies? Stable state vector Eigenvector of A EigenvalueUnit matrixEigenvector The largest eigenvalue defines the stable state vector Every probability matrix has at least one eigenvalue = 1.
23
The insulin – glycogen system At high blood glucose levels insulin stimulates glycogen synthesis and inhibits glycogen breakdown. The change in glycogen concentration N can be modelled by the sum of constant production g and concentration dependent breakdown fN. At equilibrium we have The vector {-f,g} is the stationary state vector (the largest eigenvector) of the dispersion matrix and gives the equilibrium conditions (stationary point). The value -1 is the eigenvalue of this system. The symmetric and square matrix D that contains squared values is called the dispersion matrix The glycogen concentration at equilibrium: The equilbrium concentration does not depend on the initial concentrations
24
A matrix with n columns has n eigenvalues and n eigenvectors.
25
Some properties of eigenvectors If is the diagonal matrix of eigenvalues: The product of all eigenvalues equals the determinant of a matrix. The determinant is zero if at least one of the eigenvalues is zero. In this case the matrix is singular. The eigenvectors of symmetric matrices are orthogonal Eigenvectors do not change after a matrix is multiplied by a scalar k. Eigenvalues are also multiplied by k. If A is trianagular or diagonal the eigenvalues of A are the diagonal entries of A.
26
Page Rank Google sorts internet pages according to a ranking of websites based on the probablitites to be directled to this page. Assume a surfer clicks with probability d to a certain website A. Having N sites in the world (30 to 50 bilion) the probability to reach A is d/N. Assume further we have four site A, B, C, D, with links to A. Assume further the four sites have c A, c B, c C, and c D links and k A, k B, k C, and k D links to A. If the probability to be on one of these sites is p A, p B, p C, and p D, the probability to reach A from any of the sites is therefore
27
In reality we have a linear system of 30-50 bilion equations!!! Google uses a fixed value of d=0.15. Needed is the number of links per website. Probability matrix PRank vector u Internet pages are ranked according to probability to be reached The total probability to reach A is
28
AB C D Larry Page (1973- Sergej Brin (1973-
29
Page Rank as an eigenvector problem In reality the constant is very small The final page rank is given by the stationary state vector (the vector of the largest eigenvalue).
30
Home work and literature Refresh: Vectors Vector operations (sum, S-product, scalar product) Scalar product of orthogonal vectors Distance metrics (Euclidean, Manhattan, Minkowski) Cartesian system, orthogonal vectors Matrix Types of matrices Basic matrix operations (sum, S-product, dot product) Prepare to the next lecture: Linear equations Inverse Stochiometric equations Literature: Mathe-online Stoichiometric equations: http://sciencesoft.at/equation/index?l ang=en http://sciencesoft.at/equation/index?l ang=en Stoichiometry: http://en.wikipedia.org/wiki/Stoichio metry http://en.wikipedia.org/wiki/Stoichio metry
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.