334
Curve Fitting and Biological Modeling
a. Enter all these commands and recover the least-squares line. Is it
exactly the line y = .7x + 2.1? Is it close? Perform this experiment
several times and summarize your results.
b. What is the effect of the num

328
Curve Fitting and Biological Modeling
consider a line y = mx + b as a
Although we do not yet know m and b,
candidate for the best fit one. Let
y i = mxi + b, i = 1, 2, . . . , n,
denote the y-coordinates of the points on this candidate line, with xco

A.1. The Meaning of a Measurement
!
!
347
If another researcher repeated this experiment with only one plant in
each group and found the control plant was 13.6 cm tall and the experimental one was 13.4 cm tall, would that data be surprising? What
conclusi

339
Cumulative cases (thousands)
8.3. Polynomial Curve Fitting
70
60
50
40
30
20
10
0
0
1
2
3
4
5
6
Year (from 1980)
7
8
Figure 8.3. Least-squares cubic fitting data of Table 8.4.
Why the AIDS epidemic in the United States appears to have grown cubically,

8.2. The Method of Least Squares
331
Now compare Eq. (8.7) to Eqs. (8.5) and (8.6). Amazingly, these equations
are exactly the same; Eq. (8.5) is stored in the top row of Eq. (8.7), while
Eq. (8.6) is in the bottom row. This observation provides a quick w

329
8.2. The Method of Least Squares
But the individual summands simplify as
2
i b xi )2 (yi mx
i b)
(yi mx
2
xi ) (yi mx
i b)
i b)
= (yi mx
2
2xi (yi mx
i b)
i b)
= (yi mx
2
2
i b)
+ (xi )2 (yi mx
+ (xi )2 .
i b)
= 2xi (yi mx
Therefore, the

8.2. The Method of Least Squares
325
Consider the three points (0, 0), (1, C), and (2, 0), where C > 0,
and the problem of finding the best horizontal line y = b to fit these
points.
a. Explain why any horizontal line below all three points cannot be
the

8.2. The Method of Least Squares
333
Table 8.3. Population Size in Year t
t
P
0
173
1
278
2
534
3
895
4
1553
5
2713
8.2.2. Find the least-squares, best-fit line to the data points (3, 120), (4, 116),
(5, 114), (6, 109), and (7, 106) by:
a. following the f

336
Curve Fitting and Biological Modeling
polynomial of that degree minimizing SS E can be done by a procedure very
much like that outlined in the last section. Although we will not give a proof of
why the calculation works to produce the least-squares, b

322
Curve Fitting and Biological Modeling
least used all the data in finding it, we need to be precise about what better
means. Using graphical perception or vague suspicions to choose which graph
is superior is too subjective; a different viewer might ch

292
Infectious Disease Modeling
400
350
Infectives
300
250
200
150
100
50
0
0
50
100 150 200 250 300 350 400 450 500
Susceptibles
Figure 7.2. S I phase plane for the S I R model.
epidemic, you can tell that the number of infectives increases rapidly at th

8.3. Polynomial Curve Fitting
335
d. Explain why part (c) shows
n
!
i=1
= 0.
i b)
(yi mx
e. Deduce Eq. (8.6).
8.2.9. (Calculus) The normal equations for least-squares, line fitting can
also be derived using calculus. Recall that at the minimum of a diff

324
Curve Fitting and Biological Modeling
b. For each line, compute the error vector and SS E. Which of the three
lines fits the data points best by giving the smallest SS E?
c. By looking at your graphs and making informed guesses, try to
find a line tha

318
Curve Fitting and Biological Modeling
of the patients activities during the period of the study. Fitting a simple curve
to the data is, like most models, a way of focusing attention on main features
and ignoring details we consider less important.
Our

340
Curve Fitting and Biological Modeling
Problems
8.3.1. Produce regular, semilog, and loglog plots of the data in Table 8.4.
Why do your plots indicate that an exponential curve is probably not
an appropriate model, whereas a cubic polynomial might be?

342
Curve Fitting and Biological Modeling
a. From the graphs these command produce, why does it seem most
reasonable to fit the data with a cubic?
b. From SS Es computed by these commands, why does it seem reasonable to fit the data with a cubic?
8.3.7. R

8.3. Polynomial Curve Fitting
337
As you will see in the exercises, a semilog plot of this data does not produce
the approximately linear behavior that an exponential model would lead to.
More surprisingly, a loglog plot of the data shows the transformed

Appendix B
For Further Reading
For further study, there are many textbooks focusing on mathematical models
in biology. They generally assume a solid knowledge of calculus and some
differential equations and linear algebra, though sections may be read by t

A.4. The Spread of Data
357
by 5:
(1.9 + 2.3 0.8 0.5 + 0.9)
0
= = 0.
5
5
Unfortunately, zero is not a good measure of spread. In fact, this calculation
of average differences will always give zero, as a little algebra can show. The
crux of the matter is t

7.2. Threshold Values and Critical Parameters
293
b. Algebraically, find the equilibrium points S , I for the S I R model.
Give a common-sense explanation of why the values you find are
equilibria.
c. Are these equilibria stable? Explain intuitively why t

346
!
Basic Analysis of Numerical Data
What can we conclude from this experiment? Does the nutrient cause
beans to grow more? Does it cause them to be 150% taller? Would
you feel comfortable making predictions about other beans based only
on this experime

A.4. The Spread of Data
0
2
4
6
355
8 10 12 14 16 18 20
Figure A.5. Mean = 4, median 3.3, and mode = 2.
good illustration of a skewed distribution. The median, which splits the area,
is around 3.3 on the horizontal axis. The mean, which is the balance poi

A.2. Understanding Variable Data Histograms and Distributions 351
b: The number of puppies in a litter is recorded for a large number of
dogs.
c: Downed trees in a certain forest are located, and the angles the trunks
make with due north are measured.
d:

8.3. Polynomial Curve Fitting
343
To see this, first consider an S I model, where !I = S I for some
parameter .
a. If the total population is N , and It is small relative to N , explain
why
It+1 = It + It (N It ) (1 + N )It .
b. Explain why the approximat

Appendix A
Basic Analysis of Numerical Data
Often, the goal of an experiment is the taking of some measurement or a
series of measurements. Although it may seem that, with such data in hand,
the important work has been done, and all that remains is the mo

A.2. Understanding Variable Data Histograms and Distributions 349
8
9 10 11 12 13 14
Figure A.2. A normal distribution approximating the histograms in Figure A.1.
Notice that the area of each bar tells us the number of data points in that
interval. Here,

8.2. The Method of Least Squares
327
solution to
2.3 = m 3 + b
1.7 = m 6 + b
1.3 = m 9 + b
or
31 % &
2.3
6 1 m = 1.7 .
b
91
1.3
!
(8.2)
Why cant you attempt to solve this matrix equation by finding a matrix
inverse?
Because matrix inverses can exist onl

306
Infectious Disease Modeling
an important contributor to the dynamics of the disease. The childhood
diseases such as measles and mumps are examples. Good models of such
diseases require including terms for vital dynamics, i.e., the addition
of new susc

7.2. Threshold Values and Critical Parameters
289
propose. Although a complicated model, such as one for a sexually transmitted disease, might include many additional parameters, some combination of
them should be interpretable similarly to R0 here. The b

7.3. Variations on a Theme
301
is achievable depends on many social and economic factors, but the model
identifies the target.
Studying realistic immunization issues requires using more complicated
models. Disease dynamics often are different among differ

288
Infectious Disease Modeling
Lets consider the basic reproductive number R0 = S0 = (S0 )( 1 ) from
a more biological viewpoint, in order to understand both its name and its conceptual importance. In the S I R model, the term S0 I0 measures the number
o

302
Infectious Disease Modeling
7.3.3. The analysis of the S I model is made easier if we note that St + It =
N is constant, so we can substitute the formula St = N It into the
formula for It and only track the number of infectives.
a. Do this and find a