mathematical biology nik cunniffe department of plant sciences [email protected] matrix algebra and...

27
Mathematical Biology Nik Cunniffe Department of Plant Sciences [email protected] Matrix Algebra and Applications

Upload: joseph-francis

Post on 12-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Mathematical Biology

Nik CunniffeDepartment of Plant Sciences

[email protected]

Matrix Algebra and Applications

Page 2: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Lecture One

Topic : Introduction to matrix algebra

Outline: 1) Biological context of these lectures

2) Elementary aspects of matrix algebra- what is a matrix?- special types of matrix- linear combinations of matrices- matrix multiplication- properties of matrix multiplication

Page 3: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

These lectures

Focus on two commonly used model frameworks- discrete time Markov chains- structured population models

Iterated matrix-vector products are used to solve both

Requires certain aspects of matrix algebra

Some of you may have studied matrices before, but unlikelyto have gone as far with the theory (please see first fewlectures as revision if you studied matrices at A level)

Will focus on the problems first, but before that a timetable…

Page 4: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Timetable for these lectures

This block has 7 lectures and 2 practicals

Both practicals are examples classes

There are no assessed practicals this term

No practical class today…first is Thursday 3rd May

First four and a half lectures are on matrix theory…

…applications to biology in final pair of lectures

Page 5: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Models of stochastic processes (i.e. include randomness)

Model tracks the probability of being in each of a particular set of states at each timestep

Discrete time => change every day, month, year, …

Markov => probability of transition between states depends only on the current state (i.e. no memory)

Very widely used as simple model of a random processes

Discrete time Markov chains

Page 6: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Example: take-all epidemics (fungal root disease of wheat)

Question: what is the probability of a take-all epidemicin successive years of wheat monoculture?

Discrete time Markov chains

Patch of infected wheat plants (yellow)

Infected wheat roots(withered and blackened)

Page 7: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Modelling take-all epidemicsTrack disease state of a field in successive years via two probabilities

- qm = p(no epidemic in year m)- rm = p(an epidemic in year m)

Biology summarised via state diagram which shows transitions

Epidemic this year is not always followed by epidemic in the next (inoculum will be in the soil, but weather might be unsuitable)

No epidemic this year doesn’t always mean there will definitely not be epidemic next year (since,for e.g. disease can be brought in on tools)

If no epidemic this year then the probability of no epidemic next yearis equal to 0.9

Page 8: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Modelling take-all epidemics

Questions (given an initial state):

1) What is the probability of an epidemic next year?

2) In five years?

3) In the long term?

Page 9: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Three state model: matrices allowsame generic theory to be used for absolutely any number of states

Dynamics of annual plantsModel probability in year m of a particular patch of habitat being empty or being occupied by individual of species one or of species two

e.g. if species one a goodcoloniser, this probability will be large…

…comparedto this one

Page 10: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Big assumption in Michaelmas term was that populationsare homogeneous (i.e. all members the same)

Clearly a simplification, as individuals can be categorised, e.g.- by gender- by relative fitness- by age/stage in life cycle

Category affects p(survival) and number of offspring

Earlier assumption of homogeneity can be relaxed

We concentrate on models in discrete time (for organisms with separated generations)

Models of structured populations

Page 11: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Modelling bird populationsObvious distinction between juveniles and adults

Model tracks numbers of each in year mOnly adult birds reproduce

Adults have different yearto year survival probabilitythan juvenile birds

Page 12: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Questions (given initial state):

1) What is the population size next year?

2) In five years?

3) Does the population grow or decline in the long term?

4) How does the ratio of juveniles to adults change over time?

Modelling bird populations

Page 13: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Just a set of numbers organised into a table

Size (“dimension”) is number of rows x numbers of columns- A is a “2 x 2 matrix”- B is a “2 x 3 matrix”

Notation: individual elements denoted by lower case - aij is the element in ith row and jth column of A- (for e.g. a12 = 2, b13 = 3000, b31 just doesn’t exist)- (we shall rarely need to worry about notation too much)

Matrices

Page 14: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

1) Square matrix- number of rows = number of columns

2) Identity matrix- square matrix with all elements zero, apart

from ones down the leading diagonal

3) Column matrix (aka a “vector”)- a matrix with only one column- denoted by bold (typed), underlined (written)

4) Zero matrix- every single element is zero

Special Matrices

Page 15: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Matrix addition/subtraction

To find (for e.g.) P + Q, Q – P, just add/subtract corresponding elements of the two matrices

NOTE: CAN ONLY ADD OR SUBTRACT A PAIR OF MATRICES IF THEY ARE THE SAME SIZE

(e.g. P and R are different sizes, so P + R is not defined)

Page 16: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Scalar matrix multiplication, e.g. what is 10R?

1) Multiply each element in turn by the scalar

Page 17: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Linear Combinations of Matrices

Combination of scalar multiplication and addition, e.g.

Page 18: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Multiplication is a bit more involved. Consider two matrices

There is a formal definition (given for completeness in notes)

However, don’t focus on this - will explain the method

Matrix matrix multiplication

Page 19: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Matrix matrix multiplication

See OHP for some examples

Page 20: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Algebra of matrix multiplication

See Examples Sheet for some examples

Page 21: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Matrix vector multiplication

See OHP for an example

Page 22: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Lecture TwoTopic : Determinants and linear equations

Outline : 1) Solutions of linear equations

2) Define determinant of a square matrix- 2 x 2- 3 x 3

3) How does solution of Av = b relate to the determinant of A and the value of b?

Page 23: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

A matrix vector equation is just a set of linear simultaneous equations and vice versa

See OHP for examples

A matrix vector equation like Av = b is just a set of linearsimultaneous equations

A set of linear simultaneous equations is just a matrix vector equation of the form Av = b

Note that going from simultaneous equations to Av = b iscrucial for us (since want to write models in this form)

Page 24: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Simultaneous equations to matrix vector equation

Page 25: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Determinant of a 2x2 matrix

Page 26: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Determinant of a 3x3 matrix

Page 27: Mathematical Biology Nik Cunniffe Department of Plant Sciences njc1001@cam.ac.uk Matrix Algebra and Applications

Solutions of equations