lecture 3 matrix algebra a vector can be interpreted as a file of data a matrix is a collection of...

30
Lecture 3 Matrix algebra Species Taxon Guild M ean length (mm) Site 1 Site 2 Site 3 Site 4 Nanoptilium kunzei (H eer,1841) Ptiliidae N ecrophagous 0.60 0 0 0 0 A crotrichis dispar (M atthew s,1865) Ptiliidae N ecrophagous 0.65 13 0 4 7 A crotrichis silvatica R osskothen,1935 Ptiliidae N ecrophagous 0.80 16 0 2 0 A crotrichis rugulosa R osskothen,1935 Ptiliidae N ecrophagous 0.90 0 0 1 0 A crotrichis grandicollis (Mannerheim,1844) Ptiliidae N ecrophagous 0.95 1 0 0 1 A crotrichis fratercula (M atthew s,1878) Ptiliidae N ecrophagous 1.00 0 1 0 0 C arcinops pumilio (Erichson,1834) H isteridae Predator 2.15 1 0 0 0 S aprinus aeneus (Fabricius,1775) H isteridae Predator 3.00 13 23 4 9 G nathoncus nannetensis (Marseul,1862) H isteridae Predator 3.10 0 0 0 2 Margarinotus carbonarius (Hoffmann,1803) H isteridae Predator 3.60 0 5 0 0 R ugilus erichsonii (Fauvel,1867) Staphylinidae Predator 3.75 8 0 5 0 Margarinotus ventralis (Marseul,1854) H isteridae Predator 4.00 3 2 6 1 S aprinus planiusculus M otschulsky,1849 H isteridae Predator 4.45 0 5 0 0 Margarinotus merdarius (Hoffmann,1803) H isteridae Predator 4.50 5 0 6 0 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.

Upload: winfred-wade

Post on 23-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 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

Lecture 3Matrix algebra

Species Taxon GuildMean length (mm)

Site 1 Site 2 Site 3 Site 4

Nanoptilium kunzei (Heer, 1841) Ptiliidae Necrophagous 0.60 0 0 0 0Acrotrichis dispar (Matthews, 1865) Ptiliidae Necrophagous 0.65 13 0 4 7Acrotrichis silvatica Rosskothen, 1935 Ptiliidae Necrophagous 0.80 16 0 2 0Acrotrichis rugulosa Rosskothen, 1935 Ptiliidae Necrophagous 0.90 0 0 1 0Acrotrichis grandicollis (Mannerheim, 1844) Ptiliidae Necrophagous 0.95 1 0 0 1Acrotrichis fratercula (Matthews, 1878) Ptiliidae Necrophagous 1.00 0 1 0 0Carcinops pumilio (Erichson, 1834) Histeridae Predator 2.15 1 0 0 0Saprinus aeneus (Fabricius, 1775) Histeridae Predator 3.00 13 23 4 9Gnathoncus nannetensis (Marseul, 1862) Histeridae Predator 3.10 0 0 0 2Margarinotus carbonarius (Hoffmann, 1803) Histeridae Predator 3.60 0 5 0 0Rugilus erichsonii (Fauvel, 1867) Staphylinidae Predator 3.75 8 0 5 0Margarinotus ventralis (Marseul, 1854) Histeridae Predator 4.00 3 2 6 1Saprinus planiusculus Motschulsky, 1849 Histeridae Predator 4.45 0 5 0 0Margarinotus merdarius (Hoffmann, 1803) Histeridae Predator 4.50 5 0 6 0

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.

Page 2: 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

A general structure of databases

11 1n

m1 mn

a a

A

a a

11 12 13

21 22 23

31 32 33

a a a

V a a a

a a a

1

2

3

4

a

aV

a

a

1 2 3 4V a a a a

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

11 12 13

21 22 23

31 32 33

a a a

V a a a

a a a

Page 3: 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

1234

8765

6543

4321

A

In biology and statistics are square matrices An,n of particular importance

1864

8753

6542

4321

A

The symmetric matrix is a matrix where An,m = A m,n.

1864

0753

0042

0001

A

1000

8700

6540

4321

A

Lower and upper triangular matrices

Some elementary types of matrices

1000

0700

0040

0001

A

The diagonal matrix is a square and symmetrical.

1000

0100

0010

0001

A

Unit matrix I 3Λ is a matrix with one row and one column. It is a scalar (ordinary number).

Page 4: 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 operations

1 2 3 2 4 0 2 8 1 5 14 4

2 2 4 1 2 0 7 5 5 10 9 9A

3 5 7 6 9 1 0 0 1 9 14 9

3 1 0 1 1 4 5 6 1 9 8 5

Addition and Subtraction

Addition and subtraction are only defined for matrices with identical dimensions

nmnmnn

mm

baba

baba

......

............

............

......

11

111111

BA

S-product1 2 3 1 2 3 1 2 3 3 6 9 1 2 3 3 1 3 2 3 3

2 2 4 2 2 4 2 2 4 6 6 12 2 2 4 3 2 3 2 3 4A 3

3 5 7 3 5 7 3 5 7 9 15 21 3 5 7 3 3 3 5 3 7

3 1 0 3 1 0 3 1 0 9 3 0 3 1 0 3 3 3 1 3 0

A B B A 1B A

A B B A

A (B C) (A B) C

A A

(A B) A B

A( ) A A

BB

nmn

m

bb

bb

......

............

............

......

1

111

Page 5: 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

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.

0.8

P 15 20 30 0.9 15*0.8 20*0.9 30*0.7 51

0.7

1 n

1 n i ii 1

n

b

A B a ... a ... a b scalar

b

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.

Page 6: 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

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

0.8 1.1

P 15 20 30 0.9 1.2 15*0.8 20*0.9 30*0.7 15*1.1 20*1.2 30*1.25 51 78

0.7 1.25

m m

1i i1 1i iki 1 i 111 1m 11 1k 1 1 1 k

m mn1 nm m1 mk m 1 m k

ni i1 ni iki 1 i 1

a b ... a ba ... a b ... b A B ... A B

A B ... ... ... ... ... ... ... ... ... ... ... ...

a ... a a ... a A B ... A Ba b ... a b

A B B A

(A B) C A (B C) A B C

(A B) C A C B C

ikjkij CBA

izyzlmkljkij CZDCBA ...

Page 7: 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

4039

2021

3029

44

33

21

12

5432

1234

4321

402030

392129

514

423

332

421

*4321

4312

Transpose A’ ot AT

mnn

mT

mnm

n

aa

aa

aa

aa

...

.........

.........

...

......

............

......

1

111

1

111

394

483

56.312

141459.3171828.21

3456.314159.3

981171828.2

4321T

BA TT AB

TTT ABBA )(

Page 8: 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 add in for Excel:www.digilander.libero.it/foxes/SoftwareDownload.htm

Page 9: 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

Species wros wron wil ter swi sos mil lipPterostichus nigrita (Paykull) 0 2 61 53 0 18 39 2Platynus assimilis (Paykull) 0 0 1 0 0 9 0 117Amara brunea (Gyllenhal) 1 1 0 0 19 40 0 1Agonum lugens (Duftshmid) 1 1 2 2 0 0 0 0Loricera pilicornis (Fabricius) 0 0 1 0 0 0 3 0Pterostichus vernalis (Panzer) 1 1 21 2 0 1 7 0Amara plebeja (Gyllenhal) 0 0 0 0 1 2 0 4Badister unipustulatus Bonelli 0 0 0 0 4 1 0 3Lasoitrechus discus (Fabricius) 0 0 0 1 0 0 1 0Poecilus cupreus (Linnaeus) 0 0 0 0 0 2 0 0Amara aulica (Panzer) 0 1 0 0 0 0 0 0Anisodatylus binotatus (Fabricius) 0 0 0 0 0 0 2 0Bembidion articulatum (Panzer) 0 0 0 0 0 0 1 0Clivina collaris (Herbst) 0 0 0 0 0 0 2 0

Ground beetles on Mazurian lake islands (Mamry)

Photo Marek Ostrowski

Carabus auratus Carabus problematicus

Page 10: 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

Species wros wron wil ter swi sos mil lipPterostichus nigrita (Paykull) 0 2 61 53 0 18 39 2Platynus assimilis (Paykull) 0 0 1 0 0 9 0 117Amara brunea (Gyllenhal) 1 1 0 0 19 40 0 1Agonum lugens (Duftshmid) 1 1 2 2 0 0 0 0Loricera pilicornis (Fabricius) 0 0 1 0 0 0 3 0Pterostichus vernalis (Panzer) 1 1 21 2 0 1 7 0Amara plebeja (Gyllenhal) 0 0 0 0 1 2 0 4Badister unipustulatus Bonelli 0 0 0 0 4 1 0 3Lasoitrechus discus (Fabricius) 0 0 0 1 0 0 1 0Poecilus cupreus (Linnaeus) 0 0 0 0 0 2 0 0Amara aulica (Panzer) 0 1 0 0 0 0 0 0Anisodatylus binotatus (Fabricius) 0 0 0 0 0 0 2 0Bembidion articulatum (Panzer) 0 0 0 0 0 0 1 0Clivina collaris (Herbst) 0 0 0 0 0 0 2 0

Panagaeus cruxmajor (Linnaeus) 0 24 0 0 1 0 5 1Poecilus versicolor (Sturm) 0 0 0 0 0 0 0 2Pterostichus gracilis Dejean) 0 0 0 0 0 0 0 0Stenolophus mixtus 0 0 0 1 0 0 0 0Pseudoophonus rufipes (De Geer) 0 0 13 0 0 5 3 2Harpalus latus (Linnaeus) 0 0 0 0 0 3 0 2Agonum duftshmidi Shmidt 0 0 1 0 0 0 0 0Harpalus solitaris Dejean 0 0 0 0 1 0 1 0

Species associations

Page 11: 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
Page 12: 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

S

Panagaeus cruxmajor (Linnaeus)

Poecilus versicolor (Sturm)

Pterostichus gracilis Dejean)

Stenolophus mixtus

Pseudoophonus rufipes (De Geer)

Harpalus latus (Linnaeus)

Agonum duftshmidi Shmidt

Harpalus solitaris Dejean

wros 0 0 0 0 0 0 0 0wron 24 0 0 0 0 0 0 0wil 0 0 0 0 13 0 1 0ter 0 0 0 1 0 0 0 0swi 1 0 0 0 0 0 0 1sos 0 0 0 0 5 3 0 0mil 5 0 0 0 3 0 0 1lip 1 2 0 0 2 2 0 0

Species wros wron wil ter swi sos mil lipPterostichus nigrita (Paykull) 0 2 61 53 0 18 39 2Platynus assimilis (Paykull) 0 0 1 0 0 9 0 117Amara brunea (Gyllenhal) 1 1 0 0 19 40 0 1Agonum lugens (Duftshmid) 1 1 2 2 0 0 0 0Loricera pilicornis (Fabricius) 0 0 1 0 0 0 3 0Pterostichus vernalis (Panzer) 1 1 21 2 0 1 7 0Amara plebeja (Gyllenhal) 0 0 0 0 1 2 0 4Badister unipustulatus Bonelli 0 0 0 0 4 1 0 3Lasoitrechus discus (Fabricius) 0 0 0 1 0 0 1 0Poecilus cupreus (Linnaeus) 0 0 0 0 0 2 0 0Amara aulica (Panzer) 0 1 0 0 0 0 0 0Anisodatylus binotatus (Fabricius) 0 0 0 0 0 0 2 0Bembidion articulatum (Panzer) 0 0 0 0 0 0 1 0Clivina collaris (Herbst) 0 0 0 0 0 0 2 0

Species

Panagaeus cruxmajor (Linnaeus)

Poecilus versicolor (Sturm)

Pterostichus gracilis Dejean)

Stenolophus mixtus

Pseudoophonus rufipes (De Geer)

Harpalus latus (Linnaeus)

Agonum duftshmidi Shmidt

Harpalus solitaris Dejean

Pterostichus nigrita (Paykull) 245 4 0 53 1004 58 61 39Platynus assimilis (Paykull) 117 234 0 0 292 261 1 0Amara brunea (Gyllenhal) 44 2 0 0 202 122 0 19Agonum lugens (Duftshmid) 24 0 0 2 26 0 2 0Loricera pilicornis (Fabricius) 15 0 0 0 22 0 1 3Pterostichus vernalis (Panzer) 59 0 0 2 299 3 21 7Amara plebeja (Gyllenhal) 5 8 0 0 18 14 0 1Badister unipustulatus Bonelli 7 6 0 0 11 9 0 4Lasoitrechus discus (Fabricius) 5 0 0 1 3 0 0 1Poecilus cupreus (Linnaeus) 0 0 0 0 10 6 0 0Amara aulica (Panzer) 24 0 0 0 0 0 0 0Anisodatylus binotatus (Fabricius) 10 0 0 0 6 0 0 2Bembidion articulatum (Panzer) 5 0 0 0 3 0 0 1Clivina collaris (Herbst) 10 0 0 0 6 0 0 2

Page 13: 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

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?

0010

1000

1001

0010

1101

A

A1 2 3 4

B

12345

00010

00010

11000

11000

00010

10001

B

B1 2 3 4 5

C

123456

0010

0010

1010

1010

0010

1111

0010

1000

1001

0010

1101

00010

00010

11000

11000

00010

10001

ABC

A1 2 3 4

C

123456

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.

Page 14: 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

23322221 11 SOaOFeaOFeSa

32

31

21

2322

2

2

aa

aa

aa

22230

002

002

321

321

321

aaa

aaa

aaa

22

0

0

230

102

021

3

2

1

a

a

a

Lecture 4

The Gauß scheme A linear system of equations

22230

002

002

3121

3321

3221

aaaa

aaaa

aaaa

Matrix algebra deals essentially with linear linear systems.

Multiplicative elements.A non-linear system

Solving simple stoichiometric equations

nnaaaaa uuuux ...3322110

Page 15: 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

2

1

222121

212111

2

1

2221

1211 ;

c

c

baba

baba

b

b

aa

aa

CBA

BA

2221

1211

2

1

2

1 /aa

aa

b

b

c

c

BC

2221212

2121111

babac

babac

The division through a vector or a matrix is not defined!

2 equations and four unknowns

230

102

021

/

22

0

0

3

2

1

a

a

a

Solving a linear system

22

0

0

230

102

021

3

2

1

a

a

a

Page 16: 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

For a non-singular square matrix the inverse is defined as

IAA

IAA

1

1

987

642

321

A

1296

654

321

A

r2=2r1 r3=2r1+r2

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.

nnkkkk VVVVV ...332211

A linear combination of vectors

A matrix is singular if it’s determinant is zero.

122122112221

1211

2221

1211

aaaaaa

aaDet

aa

aa

AA

A

Det A: determinant of AA matrix is singular if at least one of the parameters k is not zero.

Page 17: 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

1112

2122

21122211

1

2212

2111

1aa

aa

aaaa

aa

aa

A

A

(A•B)-1 = B-1 •A-1 ≠ A-1 •B-1

nn

nn

a

a

a

a

a

a

1...00

............

0...1

0

0...01

...00

............

0...0

0...0

22

11

1

22

11

A

A

Determinant

The inverse of a 2x2 matrix The 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

Page 18: 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

22

0

0

230

102

021

230

102

021

230

102

0211

3

2

1

3

2

1

3

2

1

1

a

a

a

a

a

a

a

a

a

I

Solving a simple linear system

23222 82114 SOOFeOFeS

23322221 11 SOaOFeaOFeSa

Page 19: 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

BAX

IAA

BAAXABAX

1

1

11

XXIIX

I

1...00

............

0...10

0...01

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

13.25.09

12833

10423

zyx

zyx

zyxSystems with a unique solution

The number of independent equations equals the number of unknowns.

3.25.09

833

423

13.25.09

12833

10423

X: Not singular The augmented matrix Xaug 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

0678.0

5627.4

3819.0

1

12

10

3.25.09

833

4231

z

y

x

Page 20: 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

1 2 3 4 1

1 2 3 4 2

31 2 3 4

41 2 3 4

1 2 3 4

1 2 3 4

1 2 3

2x 6x 5x 9x 10 x2 6 5 9 10

2x 5x 6x 7x 12 x2 5 6 7 12

x4x 4x 7x 6x 14 4 4 7 6 14

5 3 8 5 16x5x 3x 8x 5x 16

2x 3x 4x 5x 10

4x 6x 8x 10x 20

4x 5x 6x

1

2

34

41 2 3 4

1 2 3 4

1 2 3 4

1 2 3 4

1 2 3 4

x2 3 4 5 10

x4 6 8 10 20

x7x 14 4 5 6 7 14

5 6 7 8 16x5x 6x 7x 8x 16

2x 3x 4x 5x 10 2 3 4 5

4x 6x 8x 10x 12 4 6 8 10

4x 5x 6x 7x 14 4 5 6 7

5 6 75x 6x 7x 8x 16

1

2

3

4

11 2 3 4

21 2 3 4

31 2 3 4

4

1 2 3 4

1

x 10

x 12

x 14

8 16x

x2x 3x 6x 9x 10 2 3 6 9 10

x2x 4x 5x 6x 12 2 4 5 6 12

x4 5 4 7 144x 5x 4x 7x 14

x

2x 3x 4x 5x 10

4x

1

2 3 42

1 2 3 43

1 2 3 44

1 2 3 4

1 2 3 4

1 2

102 3 4 5x

6x 8x 10x 12 124 6 8 10x

4x 5x 6x 7x 14 144 5 6 7x

165 6 7 85x 6x 7x 8x 16x

1610 12 14 1610x 12x 14x 16x 16

2x 3x 4x 5x 10

4x 6x 8

1

3 42

1 2 3 43

1 2 3 44

1 2 3 4

102 3 4 5x

x 10x 12 124 6 8 10x

4x 5x 6x 7x 14 144 5 6 7x

165 6 7 85x 6x 7x 8x 16x

3210 12 14 1610x 12x 14x 16x 32

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

Page 21: 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

The transition matrix

Assume a gene with four different alleles. Each allele can mutate into anther allele.The mutation probabilities can be measured.

991.0003.0002.0001.0

004.0995.0003.0001.0

004.0001.0994.0001.0

001.0001.0001.0997.0

A→A B→A C→A D→A

Sum 1 1 11

Transition matrixProbability matrix

1.0

3.0

2.0

4.0

Initial allele frequencies

What are the frequencies in the next generation?

A→A

A→B

A→C

A→D

1008.0991.0*1.0003.0*3.0002.0*2.0001.0*4.0)1(

2999.0004.0*1.0995.0*3.0003.0*2.0001.0*4.0)1(

1999.0004.0*1.0001.0*3.0994.0*2.0001.0*4.0)1(

3994.0001.0*1.0001.0*3.0001.0*2.0997.0*4.0)1(

tD

tC

tB

tA

)(

)(

)(

)(

991.0003.0002.0001.0

004.0995.0003.0001.0

004.0001.0994.0001.0

001.0001.0001.0997.0

)1(

)1(

)1(

)1(

tD

tC

tB

tA

tD

tC

tB

tA

Σ = 1

The frequencies at time t+1 do only depent on the frequencies at time t but not on earlier ones.Markov process

)()1( tt PFF

Page 22: 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

A B C D EigenvaluesA 0.997 0.001 0.001 0.001 0.988697B 0.001 0.994 0.001 0.004 0.992303C 0.001 0.003 0.995 0.004 0.996D 0.001 0.002 0.003 0.991 1

Eigenvectors0 0 0.842927 0.48866

0.555069 0.780106 -0.18732 0.438110.241044 -0.5988 -0.46829 0.65716-0.79611 -0.1813 -0.18732 0.3707

)(

)(

)(

)(

991.0003.0002.0001.0

004.0995.0003.0001.0

004.0001.0994.0001.0

001.0001.0001.0997.0

)(

)(

)(

)(

)1(

)1(

)1(

)1(

tD

tC

tB

tA

tD

tC

tB

tA

tD

tC

tB

tA

Does the mutation process result in stable allele frequencies?

NAN Stable state vectorEigenvector of A

0)(

0

NIA

NAN

NAN

Eigenvalue Unit matrix Eigenvector

The largest eigenvalue defines the stable state vector

Every probability matrix has at least one eigenvalue = 1.

Page 23: 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

gfNN

The insulin – glycogen systemAt high blood glucose levels insulin stimulates glycogen synthesis and inhibits

glycogen breakdown.

The change in glycogen concentration DN can be modelled by the sum of constant production g and concentration

dependent breakdown fN.

01

0

g

fN

NgfN

At equilibrium we have

010

011

0

0

01

1

00111

2

2

2

2

g

f

N

N

g

f

N

N

Ng

fNN TT

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.

1

12

2

N

ND

The symmetric and square matrix D that contains squared values is called the dispersion matrix

The glycogen concentration at equilibrium:

fg

Nequi The equilbrium concentration does not depend on the initial concentrations

Page 24: 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

A matrix with n columns has n eigenvalues and n eigenvectors.

Page 25: 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

Some properties of eigenvectors

11

UUAAUUUΛAU

UΛΛU

If L is the diagonal matrix of eigenvalues:

The product of all eigenvalues equals the

determinant of a matrix.

n

i i1det A

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

0'

:)(

UUA symmetric

Eigenvectors do not change after a matrix is multiplied by a scalar k.

Eigenvalues are also multiplied by k.

0][][ uIkkAuIA

If A is trianagular or diagonal the eigenvalues of A are the diagonal

entries of A.A Eigenvalues

2 3 -1 3 23 2 -6 3

4 -5 45 5

Page 26: 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

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 cA, cB, cC, and cD links and kA, kB, kC, and kD links to A. If the probability to be on one of these sites is pA, pB, pC, and pD, the probability to reach A from any of the sites is therefore

D

ADD

C

ACC

B

ABBA c

dkp

c

dkp

c

dkpp

Page 27: 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

d

d

d

d

N

p

p

p

p

cdkcdkcdk

cdkcdkcdk

cdkcdkcdk

cdkcdkcdk

D

C

B

A

CDCBDBADA

DCDCBBACA

DBDCBCABA

DADCACBAB

1

1///

/1//

//1/

///1

Google uses a fixed value of d=0.15. Needed is the number of links per website.

Probability matrix P Rank vector u

Internet pages are ranked according to probability to be reached

C

CC

B

BB

A

AAD

D

DD

B

BB

A

AAC

D

DD

C

CC

A

AAB

D

DD

C

CC

B

BBA

cdk

pcdk

pcdk

pNd

p

cdk

pcdk

pcdk

pNd

p

cdk

pcdk

pcdk

pNd

p

cdk

pcdk

pcdk

pNd

p

The total probability to reach A is

D

ADD

C

ACC

B

ABBA c

dkp

c

dkp

c

dkpp

D

ADD

C

ACC

B

ABBA c

dkp

c

dkp

c

dkp

N

dp

Page 28: 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

15.0

15.0

15.0

15.0

41

1000

075.0115.00

075.015.0115.0

0001

D

C

B

A

p

p

p

p

PA 1 0 0 0 0.0375B -0.15 1 -0.15 -0.075 0.0375C 0 -0.15 1 -0.075 0.0375D 0 0 0 1 0.0375

P-1

1 0 0 0 A 0.03750.153453 1.023018 0.153453 0.088235 B 0.0531810.023018 0.153453 1.023018 0.088235 C 0.04829

0 0 0 1 D 0.0375

A B

C D

Larry Page (1973-

Sergej Brin (1973-

Page 29: 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

Page Rank as an eigenvector problem

15.0

15.0

15.0

15.0

41

1000

075.0115.00

075.015.0115.0

0001

D

C

B

A

p

p

p

p In reality the constant is very small

0

1000

0100

0010

0001

0000

075.0015.00

075.015.0015.0

0000

0

1000

075.0115.00

075.015.0115.0

0001

D

C

B

A

D

C

B

A

p

p

p

p

p

p

p

p

The final page rank is given by the stationary state vector (the vector of the largest eigenvalue).

A B C D EigenvaluesA 0 0 0 0 -0.15 0B -0.15 0 -0.15 -0.075 0 0C 0 -0.15 0 -0.075 0 0D 0 0 0 0 0.15 0

Eigenvectors0 0.707107 0.408248 0

0.707107 0 0.408248 0.707110.707107 -0.70711 0 -0.7071

0 0 -0.8165 0

Page 30: 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

Home work and literatureRefresh:

• 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-onlineStoichiometric equations: http://sciencesoft.at/equation/index?lang=enStoichiometry: http://en.wikipedia.org/wiki/Stoichiometry