njcLectOneAndTwo
Download
Report
Transcript njcLectOneAndTwo
Mathematical Biology
Matrix Algebra and Applications
Nik Cunniffe
Department of Plant Sciences
[email protected]
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
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 unlikely
to have gone as far with the theory (please see first few
lectures as revision if you studied matrices at A level)
Will focus on the problems first, but before that a timetable…
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
Discrete time Markov chains
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
Example:
take-all epidemics (fungal root disease of wheat)
Question: what is the probability of a take-all epidemic
in successive years of wheat monoculture?
Infected wheat roots
(withered and blackened)
Patch of infected wheat
plants (yellow)
Modelling take-all epidemics
Track 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
If no epidemic this year
then the probability of
no epidemic next year
is equal to 0.9
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)
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?
Dynamics of annual plants
Model 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 good
coloniser, this probability
will be large…
…compared
to this one
Three state model: matrices allow
same generic theory to be used
for absolutely any number of states
Models of structured populations
Big assumption in Michaelmas term was that populations
are 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)
Modelling bird populations
Obvious distinction between juveniles and adults
Model tracks numbers of each in year m
Adults have different year
to year survival probability
than juvenile birds
Only adult birds reproduce
Modelling bird populations
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?
Matrices
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)
Special Matrices
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
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)
Scalar matrix multiplication, e.g.
what is 10R?
1) Multiply each element in turn by the scalar
Linear Combinations of Matrices
Combination of scalar multiplication and addition, e.g.
Matrix matrix multiplication
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
See OHP for some examples
Algebra of matrix multiplication
See Examples Sheet for some examples
Matrix vector multiplication
See OHP for an example
Lecture Two
Topic :
Determinants and linear equations
Outline :
1) Solutions of linear equations
2) Define determinant of a square matrix
-2x2
-3x3
3) How does solution of Av = b relate to the
determinant of A and the value of b?
A matrix vector equation is just a
set of linear simultaneous
equations and vice versa
A matrix vector equation like Av = b is just a set of linear
simultaneous 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 is
crucial for us (since want to write models in this form)
See OHP for examples
Simultaneous equations to
matrix vector equation
Determinant of a 2x2 matrix
Determinant of a 3x3 matrix
Solutions of equations