8 Parameters
The variety of shapes of the nine pattern-book functions means that, often, one or another will be suitable for the modeling situation in hand.
Even if the shape of the function used is appropriate, the pattern still needs to be “adjusted” so that the units of output and input are well matched to the phenomenon being modeled. Let’s consider data from the outbreak of COVID-19 as an example. Figure 8.1 shows, day-by-day, the number of officially confirmed COVID-19 cases as the in the US in March 2020.
During the outbreak, case numbers increased with time. As time went on, the rate of case-number increase itself grew faster and faster. This is the same pattern provided by the exponential function.
Alongside the case-number data Figure 8.1 shows the function
There is an obvious mismatch between the data and the function
This chapter will introduce how modelers stretch and shift the individual patter-book functions so that they can be used in models of real-world situations such as the outbreak of COVID-19.
8.1 Matching numbers to quantities
The coordinate axes in Figure 8.1 represent quantities. On the horizontal axis is time, measured in days. The vertical axis is denominated in “10000 cases,” meaning that the numbers on the vertical scale should be multiplied by 10000 to get the number of cases.
The exponential function takes as input a pure number and produces an output that is also a pure number. This is true for all the pattern-book functions. Since the graph axes don’t show pure numbers, it is no surprise then that the pattern-book exponential function doesn’t align with the COVID case data.
If we want the input to the model function
The standard parameterization for the exponential function is
The use of a parameter like
8.2 Parallel scales
At the heart of how we use the pattern-book functions to model the relationship between quantities is the idea of conversion between one scale and another. Consider these everyday objects: a thermometer and a ruler.
Each object presents a read-out of what’s being measured—temperature or length—on two different scales. At the same time, the objects provide a way to convert one scale to another.
A function gives the output for any given input. We represent the input value as a position on a number line—which we call an “axis”—and the output as a position on another output line, almost always drawn perpendicular to one another. But the two number lines can just as well be parallel to one another. To evaluate the function, find the input value on the input scale and read off the corresponding output.
We can translate the correspondance between one scale and the other into the form of a straight-line function. For instance, if we know the temperature in Fahrenheit (
Similarly, converting inches to centimeters can be accomplished with
Both of these scale conversion functions have the form of the straight-line function, which can be written as
In Section 8.3, we will use the
In Section 8.4 we will introduce a second scale conversion function, for the output from pattern-book functions. That scaling will also be in the form of a straight-line function:
8.3 Input scaling
Figure 8.3 is based on the data frame RI-tide
which is a minute-by-minute record of the tide level in Providence, Rhode Island (USA) for the period April 1 to 5, 2010. The level
variable is measured in meters; the hour
variable gives the time of the measurement in hours after midnight at the start of April 1.
The pattern-book
To model the tide with a sinusoid, we need to modify the sinusoid to change the scale of the input and output. First, let’s look at how to accomplish the input scaling. Specifically, we want the pure-number input
The challenge is to find values for the parameters
By comparing the two axes, we can estimate that
You can calculate for yourself that the function that relates
Replacing the pure number
Figure 11.6 plots
8.4 Output scaling
Just as the natural input needs to be scaled before it reaches the pattern-book function, so the output from the pattern-book function needs to be scaled before it presents a result suited for interpreting in the real world.
The overall result of input and output scaling is to tailor the pattern-book function so that it is ready to be used in the real world.
Let’s return to Figure 11.6 which shows that the function
This is the job for output scaling, which takes the output of
or, in graphical terms
We can figure out parameters
You can confirm for yourself that the function that does the job is
Putting everything together, that is, scaling both the input to pattern-book
8.5 A procedure for building models
We’ve been using pattern-book functions as the intermediaries between input scaling and output scaling, using this format.
We can use the other pattern-book functions—the gaussian, the sigmoid, the logarithm, the power-law functions—in the same way. That is, the basic framework for modeling is this:
Pick the specific pattern-book function whose shape resembles that of the relationship you are trying to model. For instance, we picked
for modeling COVID cases versus time (at the start of the pandemic). We picked for modeling tide levels versus time.Find numerical values for the parameters
, , , and . In Chapter (chap-fitting-by-eye?) we will show you some ways to make this part of the task easier.
It is remarkable that models of a very wide range of real-world relationships between pairs of quantities can be constructed by picking one of a handful of functions, then scaling the input and the output. As we move on to other Blocks in MOSAIC Calculus, you will see how to generalize this to potentially complicated relationships among more than two quantities. That is a big part of the reason you’re studying calculus.
8.6 Other formats for scaling
Often, modelers choose to use input scaling in the form
For the COVID case-number data shown in Figure 8.2, we found that a reasonable match to the data can be had by input- and output-scaling the exponential:
You might wonder why the parameters
Another reason has to do with the algebraic properties of the exponential function. Specifically,
In the case of exponentials, writing the input scaling in the form
A bit of symbolic manipulation of the model can provide some additional insight. As you know, the properties of exponentials and logarithms are such that
where
8.7 Parameterization conventions
There are conventions for the symbols used for input-scaling parameterization of the pattern-book functions. Knowing these conventions makes it easier to read and assimilate mathematical formulas. In several cases, there is more than one conventional option. For instance, the sinusoid has a variety of parameterization forms that get used depending on which feature of the function is easiest to measure. ?tbl-param that are used in practice.
Some standard forms of input scaling parameterizations
Function | Written form | Parameter 1 | Parameter 2 |
---|---|---|---|
Exponential | Not used | ||
Exponential | Not used | ||
Exponential | Not used | ||
Exponential | Not used | ||
Power-law | exponent | ||
Sinusoid | |||
Sinusoid | |||
Sinusoid | |||
Gaussian | dnorm(x, mean, sd) | “mean” (center) | sd “standard deviation” |
Sigmoid | pnorm(x, mean, sd) | “mean” (center) | sd “standard deviation” |
Straight-line | |||
Straight-line |
8.8 Drill
Part 1 What is the period of the function
1/3 1/2 2 3 6
Part 2 What is the period of
- 1
- 5
isn’t periodic.
Part 3 What is the period of
- 1
- 5
isn’t periodic.
Part 4 One of the following choices is the standard deviation of the function graphed in Figure 8.8. Which one?
0 1 2 3 4
Part 5 What is the value of the parameter “mean” for the function shown in Figure 11.11?
- -2
- -1
- 0.5
- 1
- 2
- “mean” is not a parameter of this function.
Part 6 What is the value of the parameter “sd” for the function shown in Figure 8.10?
- -2
- -1
- 0.5
- 1
- 2
- “sd” is not a parameter of this function.
Part 7 What is the value of the parameter “mean” for the function shown in Figure 8.11?
- -2
- -1
- 0.5
- 1
- 2
- “mean” is not a parameter of this function.
Part 8 What is the value of the parameter “sd” for the function shown in Figure 8.11
- -2
- -1
- 0.5
- 1
- 2
- “sd” is not a parameter of this function.
8.9 Exercises
Exercise 8.01
Each of the following plots shows a basic modeling function whose input scaling has the form
Part A In plot (A), what is
-2 -1 0 1 2
Part B In plot (B), what is
-2 -1 0 1 2
Part C In plot (C), what is
-2 -1 0 1 2
Part D In plot (D), what is
-2 -1 0 1 2
Part E In plot (E), what is
-2 -1 0 1 2
Exercise 8.02
Each of the graphs shows two horizontal scales, one drawn on the edge graphics frame (black) and one drawn slighly above that (blue). Which horizontal scale (black or blue) corresponds to the pattern-book function shown in the graph?
Part A For graph (A), which scale corresponds to the pattern-book function?
black blue neither both
Part B For graph (B), which scale corresponds to the pattern-book function?
black blue neither both
Part C For graph (C), which scale corresponds to the pattern-book function?
black blue neither both
Exercise 8.03
Find the straight-line function that will give the value on the bottom (black) scale for each point
Part A For Graph A, which function maps blue
Part B For Graph B, which function maps blue
Part C For Graph C, which function maps blue
Part D For Graph D, which function maps blue
Exercise 8.04
The graph shows a linear combination of two sinusoids, one of period 0.6 and the other of period 2. There is also a baseline shift. That is, the graph shows the function:
Part A What is
-4 -2 0 2 4
Part B What is
0 1 2 3.5
Part C What is
0 1 2 3.5
Exercise 8.05
The Bargain Basement store wants to sell its goods quickly. Consequently, they reduce each product’s price
Part A If a jacket costs $80 today, how much will it cost in
You will need to use an R console to answer the next question. A hint: the answer is related to the answer from the previous question. Remember, to raise a number to a power, you can use an expression like 0.95^7
.
Part B You decided that you like the $80 jacket, but you have a budget of only $60. How long should you wait before coming back to the Bargain Basement store.?
3 days 4 days 5 days 6 days
Part C The answer to the first question is an exponential function, even if at first it doesn’t look like it. Which of these is the same function but written in the standard
Exercise 8.06
The three functions created by the statements below are different in important ways. Explain what those differences are.
<- makeFun(sin((2*pi/P)*t) ~ t)
f1 <- makeFun(sin((2*pi/6)*t) ~ t)
f2 <- makeFun(sin((2*pi/P)*t) ~ t, P=6) f3
Exercise 8.07
Watch this movie showing the growth of a colony of E. coli. Each rod is one bacterium.
Link to movie: https://../Modeling/www/E-coli-colony-growth.gif
Bacteria exhibit exponential growth under optimal conditions. In general, if the rate of growth depends on some quantity (here bacteria) then the exponential is the best first guess at a model. In the movie, notice that the rate of expansion depends on the number of bacteria present; the more E.coli, the faster the rate of growth. This is true for any exponential process: the instantaneous rate of growth or decay depends on the amount currently present.
If the experiment were continued indefinitely, the number of bacteria would eventually outgrow the petri dish or deplete their food source. When this happens, we say the bacteria have approached the carrying capacity of their environment. When the population is constrained in this way, a sigmoid would be a more appropriate model to start your modeling process. So, the deciding factor between exponential and sigmoid really depends upon whether 1) we assume a constrained or unconstrained environment, and 2) we let the bacteria reach the carrying capacity of the petri dish or not.
Is there any obvious sign that the bacteria are reaching the carrying capacity of their environment before the end of the movie?
Estimate the doubling time of the number of bacteria as they are growing exponentially. Do this by figuring out how long it takes the area of the colony to double (roughly). Hint: You’ll need to use the time marker in the bottom left corner of the movie.
Estimate the doubling time in another way, by observing an individual bacterium. At any point in the movie, choose a bacterium at random. Watch it until it splits in two then, immediately, note the time. Watch some more until one of the two children split. The time difference between the mother’s split and the child’s split is the doubling time.
Compare the doubling time for a mother in the center of a large colony to the doubling time of a mother on the edge of the colony. Is there any clear sign that growth in the more crowded part of the colony is slower than in the suburbs?
Credit: Math 141Z/142Z 2021-2022 development team.
Exercise 8.08
Here are four frames from a movie showing (through a microscope) the growth of E. coli. bacteria.
- In each frame, count the number of bacteria.
- Construct a data frame recording the time stamp and the number of bacteria in each frame. The unit of observation is a frame. You can use a command like this, replacing the
count
with your own numbers:
<- tibble::tribble(
Ecoli ~ time, ~ count,
100, 36,
150, 289,
200, 1683,
250, 2945
)
- Make a point plot of the number of bacteria versus time. Use linear, logarithmic or semi-logarithmic axes as most appropriate to show a simple pattern.
A. Which type of axes shows the pattern most simply?
B. Is the pattern most consistent with linear growth, exponential growth, or power-law growth.
C. From your graph, find the parameter that describes the growth rate: - If linear growth, the slope of the line (give units) - If exponential growth, the doubling time (give units) - If power law, the exponent (which will not have units).
Exercise 8.09
The diagram shows how the intensity of light from the sun depends on distance
Part A Which of these functional forms best models intensity
- Proportional:
- Power-law:
- Exponential
- Sine:
- Sigmoid
- Gaussian
Exercise 8.10
The performance
Part A Which of these functional forms best imitates the Yerkes-Dodson stress performance curve?
- Proportional:
- Power-law:
- Exponential
- Sine:
- Sigmoid
- Gaussian
A manager must balance workloads between too much and too little stimulation to get peak performance out of each team member.
Exercise 8.11
The graph shows the proportion
As a rule, when a quantity grows exponentially but is ultimately limited to some maximum level, the sigmoid is the choice for modeling. The proportion of smartphone owners grew exponentially during the early 2000’s. As the number of smartphones increased, the broader familiarity with and advertisement of smartphones also increased, which help sustain this exponential growth. However, adoption has slowed as smartphone penetration reaches the maximum carrying capacity. In other words, once everyone has a smartphone, the proportion of smartphone owners cannot increase—everyone already owns a smartphone. So, eventually the exponential growth must taper-off. According to several datasets, this inflection point occurred sometime between 2013 and 2014. This behavior is visible in the graphic below showing US smartphone penetration between Jan 2005 and Oct 2020 with raw data shown from 2010 to 2015.
Part A During the initial, exponential phase of smartphone penetration, what was the doubling time for penetration? (Note that the horizontal axis labels have 1/4 year inbetween them.)
About 2% About 6 months About 18 months About 24 months.
Part B Referring to the black sigmoid curve, what is the mean parameter?
Jan. 2010 Oct. 2010 July 2012 50%
Part C Referring to the black sigmoid curve, what is the standard deviation parameter?
Jan. 2010 Jan. 2011 Jan. 2014 19 months
Credit: 2021-2022 Math141Z/Math142Z development team.