320 likes | 473 Views
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 .
E N D
Lecture3 Matrix algebra A vectorcan be interpreted as a file of data A matrixis a collection of vectors and can be interpreted as a data base The red matrixcontainthreecolumnvectors Handlingbiological data is most easilydonewith a matrixapproach. An Excel worksheetis a matrix.
A general structure of databases The first subscriptdenotesrows, thesecondcolumns. n and m definethedimension of a matrix. Ahas m rows and n columns. Rowvector Columnvector Twomatricesareequaliftheyhavethe same dimension and allcorrespondingvaluesareidentical.
Someelementarytypes of matrices In biology and statisticsaresquarematricesAn,n of particularimportance Lower and uppertriangularmatrices Thesymmetricmatrixis a matrixwhereAn,m = A m,n. Thediagonal matrixis a square and symmetrical. Unit matrixI is a matrixwith one row and one column. Itis a scalar (ordinarynumber).
Matrix operations Addition and Subtraction Addition and subtractionareonlydefined for matriceswithidenticaldimensions S-product
Theinnerordotorscalarproduct 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. Thedotproductisonlydefined for matrices, wherethenumber of columnsinthe first matrixequalsthenumber of rowsinthesecondmatrix.
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
Matrixaddin for Excel: www.digilander.libero.it/foxes/SoftwareDownload.htm
Groundbeetles on Mazurianlakeislands (Mamry) Carabusproblematicus Carabusauratus Photo Marek Ostrowski
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 withanother group of 5 persons. The latter 5 persons had contact with other persons, say with 6, and so on. How oftendid a person of group C indirectlycontactwith a person of group A? B 1 2 3 4 5 C 1 2 3 4 5 6 A 1 2 3 4 B 1 2 3 4 5 We eliminate group B and leavethe first and last group. No. 1 of group C indirectlycontactedwithallmembers of group A. No. 2 of group A indirectlycontactedwithallsixpersons of group C. C 1 2 3 4 5 6 A 1 2 3 4
Lecture 4 Solving simple stoichiometric equations A linear system of equations TheGaußscheme Multiplicativeelements. A non-linear system Matrix algebra dealsessentiallywithlinearlinear systems.
Solving a linear system Thedivisionthrough a vectoror a matrixis not defined! 2 equations and fourunknowns
For a non-singularsquarematrixtheinverseisdefined as Singularmatricesarethosewheresomerowsorcolumnscan be expressed by a linearcombination of others. Suchcolumnsorrows do not containadditionalinformation. Theyareredundant. A matrixissingularifit’s determinant is zero. r2=2r1 r3=2r1+r2 A linearcombination of vectors Det A: determinant of A A matrixissingularifatleast one of theparameters k is not zero.
Theinverse of a 2x2 matrix Theinverse of a diagonal matrix Determinant Theinverse of a squarematrixonlyexistsifits determinant differsfrom zero. Singularmatrices do not have an inverse (A•B)-1 = B-1 •A-1 ≠ A-1 •B-1 The Nine Chapters on the Mathematical Art.(1000BC-100AD). Systems of linearequations, Gaussianelimination Theinversecan be unequivocallycalculated by the Gauss-Jordan algorithm
The general solution of a linear system Identitymatrix OnlypossibleifAis not singular. IfAissingularthe system has no solution. Systems with a uniquesolution Thenumber of independent equationsequalsthenumber of unknowns. X: Not singular TheaugmentedmatrixXaugis not singular and hasthe same rank as X. Therank of a matrixis minimum number of rows/columns of thelargestnon-singularsubmatrix
Consistent Rank(A) = rank(A:B) = n Infinitenumber of solutions Consistent Rank(A) = rank(A:B) < n No solution Inconsistent Rank(A) < rank(A:B) Infinitenumber of solutions Consistent Rank(A) = rank(A:B) < n Inconsistent Rank(A) < rank(A:B) No solution Consistent Rank(A) = rank(A:B) = n Infinitenumber of solutions
Thetransitionmatrix Assume a genewithfourdifferentalleles. Each allele canmutateintoanther allele. Themutationprobabilitiescan be measured. Initial allele frequencies A→A B→A C→A D→A A→A Whatarethefrequenciesinthenextgeneration? A→B A→C A→D Transitionmatrix Probabilitymatrix Sum 1 1 1 1 Σ = 1 Thefrequenciesat time t+1 do onlydepent on thefrequenciesat time t but not on earlierones. Markovprocess
Doesthemutationprocessresultinstable allele frequencies? Stable state vector Eigenvector of A Eigenvalue Unit matrix Eigenvector Everyprobabilitymatrixhasatleast one eigenvalue = 1. Thelargesteigenvaluedefinesthestable state vector
The insulin – glycogen system At high bloodglucoselevels insulin stimulatesglycogensynthesis and inhibitsglycogenbreakdown. ThechangeinglycogenconcentrationDN can be modelled by the sum of constantproductiong and concentration dependent breakdownfN. Atequilibrium we have Thesymmetric and squarematrixDthatcontainssquaredvaluesiscalledthedispersionmatrix Thevector {-f,g} isthestationary state vector (thelargesteigenvector) of thedispersionmatrix and givestheequilibriumconditions (stationary point). Theglycogenconcentrationatequilibrium: Theequilbriumconcentrationdoes not depend on theinitialconcentrations Thevalue -1 istheeigenvalue of this system.
Someproperties of eigenvectors IfL isthe diagonal matrix of eigenvalues: Theeigenvectors of symmetricmatricesareorthogonal Eigenvectors do not changeafter a matrixismultiplied by a scalar k. Eigenvaluesarealsomultiplied by k. Theproduct of alleigenvaluesequalsthe determinant of a matrix. The determinant is zero ifatleast one of theeigenvaluesis zero. In thiscasethematrixissingular. If A istrianagularor diagonal theeigenvalues of A arethe diagonal entries of A.
Page Rank Google sortsinternetpagesaccording to a ranking of websitesbased on theprobablitites to be directled to thispage. Assume a surferclickswithprobability d to a certainwebsite A. Having N sitesintheworld (30 to 50 bilion) theprobability to reach A is d/N. Assumefurther we havefoursite A, B, C, D, withlinks to A. AssumefurtherthefoursiteshavecA, cB, cC, and cDlinks and kA, kB, kC, and kDlinks to A. Iftheprobability to be on one of thesesitesispA, pB, pC, and pD, theprobability to reach A fromany of thesitesistherefore
Thetotalprobability to reach A is Google uses a fixedvalue of d=0.15. Neededisthenumber of links per website. In reality we have a linear system of 30-50 bilion equations!!! ProbabilitymatrixP Rankvectoru Internet pagesarerankedaccording to probability to be reached
A B D C Larry Page (1973- SergejBrin (1973-
Page Rank as an eigenvector problem In reality theconstantisverysmall Thefinalpagerankisgiven by thestationary state vector(thevector of thelargesteigenvalue).
Home work and literature • Refresh: • Vectors • Vector operations (sum, S-product, scalarproduct) • Scalarproduct of orthogonalvectors • Distancemetrics (Euclidean, Manhattan, Minkowski) • Cartesian system, orthogonalvectors • Matrix • Types of matrices • Basic matrix operations (sum, S-product, dotproduct) • Prepare to thenextlecture: • Linearequations • Inverse • Stochiometricequations Literature: Mathe-online Stoichiometricequations: http://sciencesoft.at/equation/index?lang=en Stoichiometry: http://en.wikipedia.org/wiki/Stoichiometry