-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinear.txt
1150 lines (606 loc) · 23.9 KB
/
linear.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
UNIT 2: Linear population models
----------------------------------------------------------------------
SEC Constructing models
----------------------------------------------------------------------
TSS Dynamical models
BC
Tools to link scales
Models are what we use to link:
Individual-level to population-level processes
Short time scales to long time scales
In both directions
NC
SIDEFIG webpix/touching.jpg
SIDEFIG webpix/ew_measles.png
EC
----------------------------------------------------------------------
Assumptions
BC
Models are always simplifications of reality
``The map is not the territory''
``All models are wrong, but some are useful''
Models are useful for:
linking assumptions to outcomes
identifying where assumptions are broken
NC
SIDEFIG webpix/flat.png
EC
----------------------------------------------------------------------
Dynamical models
\textbf{Dynamical models} describe rules for how a system changes at
each point in time
We will see what these assumptions about how the system
\emph{changes} lead to conclusions about what the system \emph{does}
over longer time periods
ADD should be “how these”
----------------------------------------------------------------------
States and state variables
Our dynamic models imagine that a system has a \textbf{state} at any
given time, described by one or more \textbf{state variables}
These are the things that follow our rules and change
Examples:
Dandelions: state is population size, described by one state
variable (the number of individuals)
Bacteria: state is population density, described by one state
variable (the number of individuals per ml)
Pine trees: state is amount of wood, described by one state
variable (tons per hectare)
Limiting the number of state variables is key to simple models
----------------------------------------------------------------------
Parameters
\textbf{Parameters} are the quantities that describe how the
rules for our system work
Examples:
Birth rate, death rate, fecundity, survival probability
Typically \emph{remain constant} while we are simulating a particular
scenario
\emph{Vary} when we compare different scenarios
----------------------------------------------------------------------
How do populations change?
I survey a population of elk in northern Ontario in 2019, and again in 2023.
I get a different answer the second time.
POLL What are some reasons why this answer might change?
ANS Birth
ANS Death
ANS Immigration and emigration
ANS Sampling (ie., my counts are not perfectly correct)
----------------------------------------------------------------------
Censusing and intermediate variables
Often, our population models will imagine that the population is
\textbf{censused} (counted) at particular periods of time
Calculations of what happens between census times may be part of how
we make our population model, without showing up in the main model
itself
For example, our moth and dandelion examples
----------------------------------------------------------------------
Linear population models
We will focus mostly on births and deaths
Births and deaths are done by individuals
We model the rate of each individual (per capita rates)
Total rate is the per capita rate multiplied by population size
If per capita rates are constant, we say that our population
\emph{models} are \textbf{linear}
Linear models do not usually correspond to linear growth!
What behaviour do we expect from a linear model?
ANS They usually correspond to exponential growth
ANS \ldots or exponential decline
----------------------------------------------------------------------
SS Examples
----------------------------------------------------------------------
REPSLIDE Gypsy moths
BC
A pest species that feeds on deciduous trees
Introduced to N. America from Europe ~ 150 years ago
Capable of wide-scale defoliation
NC
SIDEFIG webpix/gm_caterpillar.jpg
SIDEFIG webpix/gm_defoliation.jpg
EC
----------------------------------------------------------------------
REPSLIDE Gypsy moth populations
DOUBLEPDF ts/gm10165.simple.Rout
----------------------------------------------------------------------
Moth example
BC
POLL State variable | What might be a state variable in this system?
ANS Number of moths/ha
Parameters
ANS Number of eggs
ANS sex ratio
ANS larval survival, pupal survival, adult survival
ANS Time step
Census time
ANS Annually; use the same time (and stage) each year
NC
SIDEFIG webpix/cool_moth.jpg
EC
----------------------------------------------------------------------
Bacteria
BC
State variables
ANS Number of bacteria/ml
POLL Parameters | What might be a parameter in this system?
ANS Division rate, death rate, washout rate
Census time
ANS Always!
NC
SIDEFIG webpix/violet_bacteria.jpg
EC
----------------------------------------------------------------------
Dandelions
BC
State variables
ANS Number of dandelions in a field
POLL Are there intermediate variables?
ANS Number of seeds
Parameters
ANS Seed production, survival to adulthood, adult survival
Census time
ANS Annually, before reproduction
ANS When new and returning individuals are most similar
NC
SIDEFIG webpix/dandy_flower.jpg
SIDEFIG webpix/dandy_seeds.jpg
EC
----------------------------------------------------------------------
SS A simple discrete-time model
----------------------------------------------------------------------
Assumptions
If we have $N$ individuals after $T$ time steps, what determines how
many individuals we have after $T+1$ time steps?
A fixed proportion $p$ of the population (on
average) survives to be counted at time step $T+1$
Each individual creates (on average) $f$ new individuals
that will be counted at time step $T+1$
How many individuals do we expect in the next time step?
ANS $N_{T+1} = (pN_T+fN_T) = (p+f)N_T$
Diagram
----------------------------------------------------------------------
CONT Assumptions
BC
Individuals are \textbf{independent}: what I do does not depend on
how many other individuals are around
The population is censused at regular time intervals $\Delta
t$
Usually $\Delta t$ = 1\yr
All individuals are the same at the time of census
Population changes deterministically
NC
SIDEFIG webpix/flat.png
EC
----------------------------------------------------------------------
Definitions
$p$ is the \textbf{survival probability}
$f$ is the \textbf{fecundity}
$\lambda \equiv p + f$ is the \textbf{finite rate of increase}
... associated with the time step $\Delta t$
($\Delta t$ has units of time)
----------------------------------------------------------------------
Model
Dynamics:
$N_{T+1} = \lambda N_T$
$t_{T+1} = t_T + \Delta t$
Solution:
$N_T = N_0 \lambda^T$
$t_T = T \Delta t$
POLL How does $N$ behave in this model? | How does N behave in this model?
ANS Increases exponentially (geometrically) when $\lambda>1$
ANS Decreases exponentially when $\lambda<1$
----------------------------------------------------------------------
PSLIDE Example
BC
SIDEFIG webpix/dandy_field.jpg
SIDEFIG webpix/spreadsheet.png
NC
HREF http://tinyurl.com/DandelionModel2020 Spreadsheet (see resource page)
EC
----------------------------------------------------------------------
Interpretation
Assumptions are simplifications based on reality
We can understand why populations change exponentially sometimes
We can look for \emph{reasons} when they don't
----------------------------------------------------------------------
Examples
BC
Moths
$p=0$, so $\lambda=f$.
Moths are \textbf{semelparous} (reproduce once); they have
an \textbf{annual} population
Dandelions
If $p>0$, then the dandelions are \textbf{iteroparous}; they are
a \textbf{perennial} population
NC
SIDEFIG webpix/cool_moth.jpg
SIDEFIG webpix/dandy_flower.jpg
EC
----------------------------------------------------------------------
SS A simple continuous-time model
----------------------------------------------------------------------
Assumptions
If we have $N$ individuals at time $t$, how does the population
change?
Individuals are giving birth at per-capita rate $b$
Individuals are dying at per-capita rate $d$
How we describe the population dynamics?
ANS $\ds \frac{dN}{dt} = (b-d)N $
ANS That's what calculus is \emph{for} -- describing
instantaneous rates of change
----------------------------------------------------------------------
CONT Assumptions
Individuals are \textbf{independent}: what I do does not depend on
how many other individuals are around
The population can be censused at any time
Population size changes continuously
All individuals are the same all the time
----------------------------------------------------------------------
Definitions
$b$ is the \textbf{birth rate}
$d$ is the \textbf{death rate}
$r \equiv b-d$ is the {\bf instantaneous rate of increase}.
These quantities have true units:
ANS 1/[time]
ANS $\equiv$ (indiv/[time])/indiv
COMMENT With units, we don't need to mess with “associated with a time
period”
----------------------------------------------------------------------
Model
Dynamics:
$\ds \frac{dN}{dt} = rN $
Solution:
$N(t) = N_0 \exp(rt)$
Behaviour
ANS Increases exponentially when $r>0$
ANS Decreases exponentially when $r<0$
----------------------------------------------------------------------
Bacteria
Conceptually, this is just as simple as the dandelions or the moths
In fact, simpler
On the computer, it's a little more complicated to simulate
----------------------------------------------------------------------
CONT Bacteria
DOUBLEFIG exponential/growth.Rout-0.pdf exponential/growth.Rout-1.pdf
----------------------------------------------------------------------
Summary
We can construct simple, conceptual models and make them into
dynamic models
If we assume that \emph{individuals} behave independently, then
we expect \emph{populations} to grow (or decline) exponentially
----------------------------------------------------------------------
SEC Units and scaling
----------------------------------------------------------------------
Units are our friends
BC
Keep track of units at all times
Use units to confirm that your answers make sense
Or to find quick ways of getting the answer
What is $3\dd \cdot 4 \esp/\dd$?
ANS $12\esp$
What is $1\hr \cdot 0.2\cm/\dd$?
ANS $1\hr \cdot 0.2\cm/\dd$
ANS $1\hr \cdot 0.2\cm/\dd \cdot \frac{1\dd}{24\hr}$
ANS 0.0083\cm
NC
SIDEFIG webpix/espresso.jpg
EC
----------------------------------------------------------------------
Manipulating units
BC
We can {multiply} quantities with different units by keeping track
of the units
We \emph{cannot} {add} quantities with different units (unless they
can be converted to the same units)
POLL How many seconds are there in a day?
ANS
$\bigeq \frac{60 \uname{sec}}{\uname{min}} $
$\bigeq \cdot \frac{60 \uname{min}}{\uname{hr}} $
$\bigeq \cdot \frac{24\uname{hr}}{\uname{day}}$
ANS 86400 \uname{sec}/\uname{day}
NOTES http://www.alysion.org/dimensional/fun.htm
NC
SIDEFIG webpix/clock.jpg
EC
----------------------------------------------------------------------
Scaling
Quantities with units set scales, which can be changed
If I multiply all the quantities with units of time in my model
by 10, I should get an answer that looks the same, but
with a different time scale
If a multiply all the quantities with units of dandelions in my
model by 10, I should get an answer that looks the same, but with
a different number of dandelions
----------------------------------------------------------------------
PSLIDE Scaling time in bacteria
DOUBLEFIG exponential/growth.Rout-0.pdf exponential/growth.Rout-1.pdf
----------------------------------------------------------------------
Scaling time in bacteria
DOUBLEFIG exponential/growth.Rout-0.pdf exponential/growth.Rout-2.pdf
----------------------------------------------------------------------
ASLIDE Scaling population
DOUBLEFIG exponential/growth.Rout-0.pdf exponential/growth.Rout-3.pdf
----------------------------------------------------------------------
ASLIDE Scaling population
DOUBLEFIG exponential/growth.Rout-0.pdf exponential/growth.Rout-4.pdf
----------------------------------------------------------------------
Thinking about units
POLL What is $10^{3 \dd}$? | What is 10 to the power of 3d?
NOANS
What is $10^{72\hr}$?
ANS Nonsense! $72\hr$ means \emph{exactly} the same thing as
$3\dd$ -- there is no way to resolve this to make sense.
What is $3\dd \cdot 3\dd$?
ANS $9\dd^2$ -- this \emph{could} make sense
ANS but you probably asked the wrong question
ANS \ldots very different from $9\dd$.
----------------------------------------------------------------------
Unit-ed quantities
Quantities with units \emph{scale}
If you change everything with the same units by the same factor,
you should not change the behaviour of your system
We typically make sense of quantities with units by comparing them
to other quantities with the same units, e.g.:
birth rate vs.\ death rate
characteristic time of exponential growth vs.\ observation time
----------------------------------------------------------------------
Unitless quantities
Quantities in exponents must be unitless
Quantities with variable exponents (quantities that can be
multiplied by themselves over and over) must be unitless
Quantities that determine \emph{how} a system behaves must have a
unitless form
Otherwise, they could be scaled
Zero works as a unitless quantity:
0km = 0cm
What unitless quantities have we already talked about?
ANS $\lambda$, $f$ and $p$.
ANS These all depend on a time period
----------------------------------------------------------------------
REPSLIDE Moth calculation
Researchers studying a gypsy moth population make the following
estimates:
The average reproductive female lays 600 eggs
10% of eggs hatch into larvae
10% of larvae mature into pupae
50% of pupae mature into adults
50% of adults survive to reproduce
All adults die after reproduction
----------------------------------------------------------------------
Moths
$600 \uname{egg}/\uname{rF}$
$\cdot 0.1 \uname{larva}/\uname{egg}$
$\cdot 0.1 \uname{pupa}/\uname{larva}$
$\cdot 0.5 \uname{A}/\uname{pupa}$
$\cdot 0.5 \uname{rA}/\uname{A}$
POLL What's the product?
ANS $1.5\uname{rA}/\uname{rF}$
ANS Not enough information to make a prediction!
ANS Need to multiply by something with units rF/rA to close the
loop
----------------------------------------------------------------------
Closing the loop
Once we close the loop, it doesn't matter where we start:
Reproductive adults to reproductive adults
Larvae to larvae
Pupae to pupae is common in real studies
ANS Pupae are easy to count
ANS Egg masses, too (depending on species)
If we don't close the loop, we can't correctly move from step to step
----------------------------------------------------------------------
Calculating $\lambda$
$\lambda \equiv p + f$ is the \textbf{finite rate of increase}
If $N_{T+1} = \lambda N_T$, what are the units of $\lambda$?
ANS We multiply by $\lambda$ over and over
ANS Therefore $\lambda$ must be unitless
Therefore $p$ and $f$ must be unitless
example, rA/rA; seed/seed
to do it right, we close the loop
----------------------------------------------------------------------
SEC Key parameters
----------------------------------------------------------------------
TSS Discrete-time model
$N_{T+1} = \lambda N_T$
$\lambda \equiv p + f$
----------------------------------------------------------------------
Calculating fecundity
Fecundity $f$ in our model must be unitless
Multiply:
Probability of surviving from census to reproduction
Expected number of offspring when reproducing (maternity)
Probability of offspring surviving to census
Need to end where we started
Diagram
----------------------------------------------------------------------
Calculating survival
Survival $p$ must be unitless
Multiply:
Probability of surviving from census to reproduction
Probability of surviving the reproduction period
Probability of surviving until the next census
----------------------------------------------------------------------
Finite rate of increase
Population increases when $\lambda>1$
So $\lambda$ must be unitless
But it is \emph{associated with} the time step $\Delta t$
Potentially confusing. It is often better to
use $\R$ or $r$ (see below).
----------------------------------------------------------------------
Reproductive number
The reproductive number \R\ measures the average number of offspring
produced by a single individual over the course of its lifetime
POLL The population will increase when \R\ldots:| The population will increase when R … .
ANS $\R>1$
POLL What are the units of \R? |What are the units of R?
ANS \R\ must be unitless
----------------------------------------------------------------------
Lifespan
In this model world, how long do individuals live, on average?
If $p$ is the proportion of individuals that survive, then the
proportion that die is:
ANS $\mu = 1-p$
How many time steps do you expect to survive, on average?
ANS $1/\mu$
ANS Roughly makes sense, and is also right (trust me)
ANS \ldots\ or ask me
ANS Average lifetime is $1/\mu * \Delta t$
----------------------------------------------------------------------
Calculating \R
\R\ is fecundity multiplied by lifespan
$\R = f/\mu = f/(1-p)$
Both $f$ and $1/(1-p)$ are unitless (but associated with the time step)!
ANS Offspring per time steps
ANS Life span in time steps
----------------------------------------------------------------------
Comparison
BCC
\emph{Lifetime reproduction}
$\R = f/\mu = f/(1-p)$
Unitless
Population behaviour depends on the \textbf{comparison} $\R:1$
Equivalent to $f:\mu$
NCC
\emph{Reproduction over one time step}
$\lambda = f+p = f+(1-\mu)$
Unitless
Population behaviour depends on the comparison $\lambda:1$
Equivalent to $f:\mu$
EC
----------------------------------------------------------------------
Is the population increasing?
What does $\lambda$ tell us about whether the population is
increasing?
ANS Population is increasing each time step when $\lambda>1$
What does $\R$ tell us about whether the population is increasing?
ANS Population is increasing when $\R>1$. Each individual is (on
average) more than replacing itself over its lifetime
Therefore, these two criteria must be the same!
ANS Both come down to $f>\mu$.
----------------------------------------------------------------------
SS Continuous-time model
----------------------------------------------------------------------
Calculating birth rate
The birth rate $b$ in the continuous-time model is new individuals
per individual per unit time
An instaneous rate
Units of [1/time] -- implies what assumption?
ANS New individuals are cancelling with old individuals in the equation
ANS New individuals are being treated the same as old individuals
ANS Not very realistic -- a potential problem with our model world
----------------------------------------------------------------------
Calculating death rate
The death rate $d$ in the continuous-time model is deaths per
individual per unit time
An instaneous rate
Units of [1/time]
What happens to the individuals?
ANS The units cancel: individuals show up in the deaths part and in the
population part.
----------------------------------------------------------------------
Instaneous rate of increase
Population increases when $r=b-d > 0$
$r$ is not unitless, units are:
ANS [1/time]
So how can $r=0$ be a criterion? | How can r=0 be a criterion?
ANS Because 0$\times$anything is unitless!
ANS 0km = 0cm!
----------------------------------------------------------------------
Calculating \R
The mean lifespan is $L = 1/d$
Equivalent to the characteristic time for the death process
\R\ is the average number of births expected over that time frame:
$\R = bL = b/d$
----------------------------------------------------------------------
Comparison
BCC
\emph{Lifetime reproduction}
$\R = bL = b/d$
Unitless
Population behaviour depends on the comparison $\R:1$
Equivalent to $b:d$
NCC
\emph{Instantaneous change}
$r = b-d $
Units [1/t] (a rate)
Population behaviour depends on the comparison $r:0$
Equivalent to $b:d$
EC