Applied math lecture notes

11
AM115 Lecture Notes Probabilistic Models: P r (X (t)= N ) = lim m→∞ 1 m (number of realizations containing exactly N individu- als at time t) (m is total number of realizations) Conditional probability: P r (z |y) (probability of z given y) P r (X (t + h)= N + 1)|X (t)= N ) if you know population at t is N, what’s the probability of population at time t + h being N + 1 (birth process) = B(N )h P r (X (t + h)= N - 1)|X (t)= N ) if you know population at t is N, what’s the probability of population at time t + h being N - 1 (death process) = D(N )h P r (X (t + h)= N )|X (t)= N ) if you know population at t is N, what’s the proba- bility of population at time t + h being N (stays the same) = 1 - (B(N )+ D(N ))h (for h that’s sufficiently small such that these are the only three events that can occur during h) B(N )= λN , birth rate is linear function of population D(N )= μN (N - 1), death rate depends on crowding. Using N (N - 1) instead of N 2 so that when there’s one person left, the death rate is 0, so all of the people can’t die out. With N 2 , N = 0 is an absorbing state, meaning birth rate and death rate there would have been 0, so you would get stuck. ˙ N = λN - μN (N - 1) = λN - μN 2 + μN =(λ + μ)N - μN 2 = N (λ + μ - μN ) 1

description

Notes on probabilistic models, differential equations, eigenvector and eigenvalue analysis, etc.

Transcript of Applied math lecture notes

Page 1: Applied math lecture notes

AM115 Lecture Notes

Probabilistic Models:

Pr(X(t) = N) = limm→∞1m

(number of realizations containing exactly N individu-als at time t)

(m is total number of realizations)

Conditional probability: Pr(z|y) (probability of z given y)

Pr(X(t + h) = N + 1)|X(t) = N) if you know population at t is N, what’s theprobability of population at time t+ h being N + 1 (birth process) = B(N)h

Pr(X(t + h) = N − 1)|X(t) = N) if you know population at t is N, what’s theprobability of population at time t+ h being N − 1 (death process) = D(N)h

Pr(X(t + h) = N)|X(t) = N) if you know population at t is N, what’s the proba-bility of population at time t+h being N (stays the same) = 1− (B(N) +D(N))h(for h that’s sufficiently small such that these are the only three events that canoccur during h)

B(N) = λN , birth rate is linear function of population

D(N) = µN(N − 1), death rate depends on crowding. Using N(N − 1) instead ofN2 so that when there’s one person left, the death rate is 0, so all of the peoplecan’t die out.

With N2, N = 0 is an absorbing state, meaning birth rate and death rate therewould have been 0, so you would get stuck.

N = λN − µN(N − 1)

= λN − µN2 + µN

= (λ+ µ)N − µN2

= N(λ+ µ− µN)

1

Page 2: Applied math lecture notes

= (λ+ µ)N(1− µ

λ+ µN)

It resembles the logistic equation: (λ+ µ) is growth rate, µλ+µ

is carrying capacity.

Pr(z, y) = Pr(z|y)Pr(y)

Pr(z) =∑

all possible y’s

Pr(z, y)

Pr(X(t + h) = N) = B(N − 1)h ∗ Pr(X(t) = N − 1) + D(N + 1)h ∗ Pr(X(t) =N + 1) + [1− (B(N) +D(N))]Pr(X(t) = N)

Define: [PN(t) = Pr(X(t) = N)]→

PN(t+h)−PN(t) = B(N−1)h∗PN−1(t)+D(N+1)h∗PN+1(t)−(B(N)+D(N))h∗PN(t)

δPNδt

= D(N + 1)PN+1 − (B(N) +D(N))PN +B(N − 1)PN−1

For steady state, say population is πN ... derivative is zero.

D(N + 1)πN+1 − (B(N) +D(N))πN +B(N − 1)πN−1 = 0

D(N + 1)πN+1 − B(N)πN = D(N)πN − B(N − 1)πN − 1... this is a recursiverelationship. Keep going until you get:

D(N + 1)πN+1 −B(N)πN = D(1)π1 −B(0)π0

and we know D(1) = 1 and B(0) = 0, so

2

Page 3: Applied math lecture notes

D(N + 1)πN+1 −B(N)πN = 0→ D(N + 1)πN+1 = BNπN

Intution: to reach a steady state population, the number of deaths has to equal thenumber of births at N.

πN+1 = B(N)D(N+1)

πN

πN = λµNπN−1 → written recursively:

= λµ2N(N−1)πN−2 =...

=λµ

2

N !π1

1 =∞∑N=1

πN

1 = π1∞∑N=1

(λ−µ)N−1

N !

Use the Taylor expansion of ex

πN =λµ

N

N ![exp(λµ)−1]N for N = 1, 2, 3...

More than one species:

Example 1: Love affairs

Define two variables - R(t) = Romeo’s Love to Juliet

J(t) = Juliet’s love to Romeo

Two differential equations:dR

dt= aR + bJ

dJ

dt= cR + dJ

You can plot the trajectory at each point J and R. This forms a vector field in J-Rspace. This is called a ”phase portrait”

3

Page 4: Applied math lecture notes

First case: a = 0 and b = (+) for Romeo. c = (−) and d = 0. Romeo wants Julietbut she’s like nah. This results in an endless cycle of love and hate. The phasediagram is circles.

ddt

(RJ

)= A

(RJ

)A = (

a bc d

)

Eigenvectors can give stability paths. Negative eigenvalues means values will decayto 0.

Spring example:

mg = kx0 at starting point

x = v

v =k

mx

You can draw the phase portrait:

Closed orbits.

4

Page 5: Applied math lecture notes

d~xdt

= A~x, where A =

(a bc d

)Find characteristic equation by setting determinant of A− λI to 0.

λ2 − τλ+ ∆ = 0

τ = trace(A) = a+ d

∆ = detA = ad− bc

λ1 =τ +√τ 2 − 4∆

2, λ2 =

τ −√τ 2 − 4∆

2

Saddle point:

Unstable node:

5

Page 6: Applied math lecture notes

Unstable spiral:

Stable spiral:

6

Page 7: Applied math lecture notes

Stable node:

Solution:

Assuming λ1 and λ2 are distinct, the solution is:

~x(t) = c1eλ1t~v1 + c2e

λ2t~v2

Since the system is linear, linear combinations of this solution will also work. Allyou need to do is pick c1 and c2 that satisfy the initial conditions.

7

Page 8: Applied math lecture notes

Competing species:

1

x

dx

dt= (a1 − b1)y

1

y

dy

dt= (a2 − b2)x

This is a non-linear system because we have the product between x and y.

Let’s look at the fixed points before solving...

Nullcline: dxdt

= 0 and dydy

= 0

Now we introduce a carrying capacity to the model:

dx

dt= x(a1 − c1x− b1y)

dy

dt= x(a2 − b2x− c2y)

Competition within its own species.

8

Page 9: Applied math lecture notes

Ix =a1c1

(competition within species 1)− a2b2

(competition from other species)

Iy =a2c2

(competition within species 2)− a1b1

(competition from other species)

The two species can only coexist if Ix and Iy are both negative. This means thatthe competition between the two species is not very strong (not sure about this?)

Fitting data:

Hooke’s Law again:

F = kx

We measure a bunch of forces at different displacements, and we want to try tocalculate k. How do we estimate k from a whole bunch of data (knowing that thereare measurement errors)?

Fit the data with a linear function that goes through the origin.

In general, we have a function y(t) = β1φ1(t) + β2φ2(t) + ...+ βnφn(t)

and we take measurements yi = y(ti) for i = 1, 2, ...,m

9

Page 10: Applied math lecture notes

φj are called basis functions. yi are measurements.

We define the residual: ri = yi −n∑j=1

βjφj(ti). This is the difference between the

measurement and the model. There will be a residual for every data point, form-ing a residual vector ~r = (r1, r2...rm). We try to find β values that minimize theresidual.

We define L1, L2, LP norms that convert the vectors to numbers:

||~r||1 =m∑i=1

|rj|

||~r||2 =

√√√√ m∑i=1

|rj|2

||~r||p = (m∑i=1

|rj|p)1p

L2 called least squares. We assume measurement errors are independent, and in-dividual errors follow a Gaussian distribution. (Given this model, how likely is itthat this data is being generated by this model?)

Because independent. Want to maximize this probability. We’ll take the log.

minm∑i=1

[yi − y(ti, ~β)

σi]2

Random walk:

a is step size, τ is time step size

Pr(x, t+ τ) =1

2[Pr(x+ a, t) + Pr(x− a, t)]

Pr(x, t+ τ) ≈ Pr(x, t) + τδPr(x, t)

δt

Pr(x+ a, τ) ≈ Pr(x, t) + τδPr(x, t)

δt

10

Page 11: Applied math lecture notes

Pr(x+ a, τ) ≈ Pr(x, t) + τδPr(x, t)

δt

11