Fitting Exponential Models to Data
By the end of this section, you will be able to:
- Build an exponential model from data
- Build a logarithmic model from data
- Build a logistic model from data
In previous sections of this chapter, we were either given a function explicitly to graph or evaluate, or we were given a set of points that were guaranteed to lie on the curve. Then we used algebra to find the equation that fit the points exactly. In this section, we use a modeling technique called regression analysis to find a curve that models data collected from real-world observations. With regression analysis, we don’t expect all the points to lie perfectly on the curve. The idea is to find a model that best fits the data. Then we use the model to make predictions about future events.
Do not be confused by the word model. In mathematics, we often use the terms function, equation, and model interchangeably, even though they each have their own formal definition. The term model is typically used to indicate that the equation or function approximates a real-world situation.
We will concentrate on three types of regression models in this section: exponential, logarithmic, and logistic. Having already worked with each of these functions gives us an advantage. Knowing their formal definitions, the behavior of their graphs, and some of their real-world applications gives us the opportunity to deepen our understanding. As each regression model is presented, key features and definitions of its associated function are included for review. Take a moment to rethink each of these functions, reflect on the work we’ve done so far, and then explore the ways regression is used to model real-world phenomena.
Building an Exponential Model from Data
As we’ve learned, there are a multitude of situations that can be modeled by exponential functions, such as investment growth, radioactive decay, atmospheric pressure changes, and temperatures of a cooling object. What do these phenomena have in common? For one thing, all the models either increase or decrease as time moves forward. But that’s not the whole story. It’s the way data increase or decrease that helps us determine whether it is best modeled by an exponential equation. Knowing the behavior of exponential functions in general allows us to recognize when to use exponential regression, so let’s review exponential growth and decay.
Recall that exponential functions have the form or . When performing regression analysis, we use the form most commonly used on graphing utilities, . Take a moment to reflect on the characteristics we’ve already learned about the exponential function (assume ):
- must be greater than zero and not equal to one.
- The initial value of the model is .
- If , the function models exponential growth. As increases, the outputs of the model increase slowly at first, but then increase more and more rapidly, without bound.
- If , the function models exponential decay. As increases, the outputs for the model decrease rapidly at first and then level off to become asymptotic to the -axis. In other words, the outputs never become equal to or less than zero.
As part of the results, your calculator will display a number known as the correlation coefficient, labeled by the variable , or . (You may have to change the calculator’s settings for these to be shown.) The values are an indication of the “goodness of fit” of the regression equation to the data. We more commonly use the value of instead of , but the closer either value is to 1, the better the regression equation approximates the data.
Exponential Regression. Exponential regression is used to model situations in which growth begins slowly and then accelerates rapidly without bound, or where decay begins rapidly and then slows down to get closer and closer to zero. We use the command “ExpReg” on a graphing utility to fit an exponential function to a set of data points. This returns an equation of the form
Note that:
- must be non-negative.
- when , we have an exponential growth model.
- when , we have an exponential decay model.
How to: given a set of data, perform exponential regression using a graphing utility.
- Use the STAT then EDIT menu to enter given data.
- Clear any existing data from the lists.
- List the input values in the L1 column.
- List the output values in the L2 column.
- Graph and observe a scatter plot of the data using the STATPLOT
feature.
- Use ZOOM [9] to adjust axes to fit the data.
- Verify the data follow an exponential pattern.
- Find the equation that models the data.
- Select “ExpReg” from the STAT then CALC menu.
- Use the values returned for and to record the model, .
- Graph the model in the same window as the scatterplot to verify it is a good fit for the data.
Example. In 2007, a university study was published investigating the crash risk of alcohol impaired driving. Data from 2,871 crashes were used to measure the association of a person’s blood alcohol level (BAC) with the risk of being in an accident. The table below shows results from the study. The relative risk is a measure of how many times more likely a person is to crash. So, for example, a person with a BAC of is times as likely to crash as a person who has not been drinking alcohol.
| BAC | 0 | 0.01 | 0.03 | 0.05 | 0.07 | 0.09 | 0.11 | 0.13 | 0.15 | 0.17 | 0.19 | 0.21 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Relative Risk of Crashing | 1 | 1.03 | 1.06 | 1.38 | 2.09 | 3.54 | 6.41 | 12.6 | 22.1 | 39.05 | 65.32 | 99.78 |
- Let represent the BAC level, and let represent the corresponding relative risk. Use exponential regression to fit a model to these data.
- After 6 drinks, a person weighing 160 pounds will have a BAC of about . How many times more likely is a person with this weight to crash if they drive after having a 6-pack of beer? Round to the nearest hundredth.
Solution.
Using the STAT then EDIT menu on a graphing utility, list the BAC values in L1 and the relative risk values in L2. Then use the STATPLOT feature to verify that the scatterplot follows the exponential pattern shown below:
Use the “ExpReg” command from the STAT then CALC menu to obtain the exponential model,
Converting from scientific notation, we have:
Notice that which indicates the model is a good fit to the data. To see this, graph the model in the same window as the scatterplot to verify it is a good fit, as shown below:
Use the model to estimate the risk associated with a BAC of . Substitute for in the model and solve for .
If a 160-pound person drives after having 6 drinks, they are about times more likely to crash than if driving while sober.
The table below shows a recent graduate’s credit card balance each month after graduation.
| Month | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| Debt ($) | 620.00 | 761.88 | 899.80 | 1,039.93 | 1,270.63 | 1,589.04 | 1,851.31 | 2,154.92 |
Use exponential regression to fit a model to that data, lettingbe the month number.
Enter the month in L1 and the debt in L2, then run ExpReg to findandfor.If spending continues at this rate, what will the graduate’s credit card debt be one year (month 12) after graduating?
$4,499.38Evaluate the model you just found at.Q&A. Is it reasonable to assume that an exponential regression model will represent a situation indefinitely?
No. Remember that models are formed by real-world data gathered for regression. It is usually reasonable to make estimates within the interval of original observation (interpolation). However, when a model is used to make predictions, it is important to use reasoning skills to determine whether the model makes sense for inputs far beyond the original observation interval (extrapolation).
Building a Logarithmic Model from Data
Just as with exponential functions, there are many real-world applications for logarithmic functions: intensity of sound, pH levels of solutions, yields of chemical reactions, production of goods, and growth of infants. As with exponential models, data modeled by logarithmic functions are either always increasing or always decreasing as time moves forward. Again, it is the way they increase or decrease that helps us determine whether a logarithmic model is best.
Recall that logarithmic functions increase or decrease rapidly at first, but then steadily slow as time moves on. By reflecting on the characteristics we’ve already learned about this function, we can better analyze real world situations that reflect this type of growth or decay. When performing logarithmic regression analysis, we use the form of the logarithmic function most commonly used on graphing utilities, . For this function
- All input values, , must be greater than zero.
- The point is on the graph of the model.
- If , the model is increasing. Growth increases rapidly at first and then steadily slows over time.
- If , the model is decreasing. Decay occurs rapidly at first and then steadily slows over time.
Logarithmic Regression. Logarithmic regression is used to model situations where growth or decay accelerates rapidly at first and then slows over time. We use the command “LnReg” on a graphing utility to fit a logarithmic function to a set of data points. This returns an equation of the form,
Note that
- all input values, , must be non-negative.
- when , the model is increasing.
- when , the model is decreasing.
How to: given a set of data, perform logarithmic regression using a graphing utility.
- Use the STAT then EDIT menu to enter given data.
- Clear any existing data from the lists.
- List the input values in the L1 column.
- List the output values in the L2 column.
- Graph and observe a scatter plot of the data using the STATPLOT
feature.
- Use ZOOM [9] to adjust axes to fit the data.
- Verify the data follow a logarithmic pattern.
- Find the equation that models the data.
- Select “LnReg” from the STAT then CALC menu.
- Use the values returned for and to record the model, .
- Graph the model in the same window as the scatterplot to verify it is a good fit for the data.
Example. Due to advances in medicine and higher standards of living, life expectancy has been increasing in most developed countries since the beginning of the 20th century.
The table below shows the average life expectancies, in years, of Americans from 1900–2010.
| Year | 1900 | 1910 | 1920 | 1930 | 1940 | 1950 | 1960 | 1970 | 1980 | 1990 | 2000 | 2010 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Life Expectancy (Years) | 47.3 | 50.0 | 54.1 | 59.7 | 62.9 | 68.2 | 69.7 | 70.8 | 73.7 | 75.4 | 76.8 | 78.7 |
- Let represent time in decades starting with for the year 1900, for the year 1910, and so on. Let represent the corresponding life expectancy. Use logarithmic regression to fit a model to these data.
- Use the model to predict the average American life expectancy for the year 2030.
Solution.
Using the STAT then EDIT menu on a graphing utility, list the years using values 1–12 in L1 and the corresponding life expectancy in L2. Then use the STATPLOT feature to verify that the scatterplot follows a logarithmic pattern, as shown below:
Use the “LnReg” command from the STAT then CALC menu to obtain the logarithmic model,
Next, graph the model in the same window as the scatterplot to verify it is a good fit, as shown below:
To predict the life expectancy of an American in the year 2030, substitute for the decade in the model and solve for :
If life expectancy continues to increase at this pace, the average life expectancy of an American will be by the year 2030.
Sales of a video game released in the year 2000 took off at first, but then steadily slowed as time moved on. The table below shows the number of games sold, in thousands, from the years 2000–2010.
| Year | 2000 | 2001 | 2002 | 2003 | 2004 | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Number Sold (Thousands) | 142 | 149 | 154 | 155 | 159 | 161 | 163 | 164 | 164 | 166 | 167 |
Letrepresent time in years starting withfor the year 2000, and letrepresent the number of games sold in thousands. Use logarithmic regression to fit a model to that data.
Enter the year number in L1 and the thousands sold in L2, then run LnReg to findandfor.If games continue to sell at this rate, how many games will sell in the year 2015 ()? Round to the nearest thousand.
171,000 gamesEvaluate the model you just found at, then round the result (in thousands) to the nearest whole thousand.Building a Logistic Model from Data
Like exponential and logarithmic growth, logistic growth increases over time. One of the most notable differences with logistic growth models is that, at a certain point, growth steadily slows and the function approaches an upper bound, or limiting value. Because of this, logistic regression is best for modeling phenomena where there are limits in expansion, such as availability of living space or nutrients.
It is worth pointing out that logistic functions actually model resource-limited exponential growth. There are many examples of this type of growth in real-world situations, including population growth and spread of disease, rumors, and even stains in fabric. When performing logistic regression analysis, we use the form most commonly used on graphing utilities:
Recall that:
- is the initial value of the model.
- when , the model increases rapidly at first until it reaches its point of maximum growth rate, . At that point, growth steadily slows and the function becomes asymptotic to the upper bound .
- is the limiting value, sometimes called the carrying capacity, of the model.
Logistic Regression. Logistic regression is used to model situations where growth accelerates rapidly at first and then steadily slows to an upper limit. We use the command “Logistic” on a graphing utility to fit a logistic function to a set of data points. This returns an equation of the form
Note that
- The initial value of the model is .
- Output values for the model grow closer and closer to as time increases.
How to: given a set of data, perform logistic regression using a graphing utility.
- Use the STAT then EDIT menu to enter given data.
- Clear any existing data from the lists.
- List the input values in the L1 column.
- List the output values in the L2 column.
- Graph and observe a scatter plot of the data using the STATPLOT
feature.
- Use ZOOM [9] to adjust axes to fit the data.
- Verify the data follow a logistic pattern.
- Find the equation that models the data.
- Select “Logistic” from the STAT then CALC menu.
- Use the values returned for , , and to record the model, .
- Graph the model in the same window as the scatterplot to verify it is a good fit for the data.
Example. Mobile telephone service has increased rapidly in America since the mid 1990s. Today, almost all residents have cellular service. The table below shows the percentage of Americans with cellular service between the years 1995 and 2012.
| Year | 1995 | 1996 | 1997 | 1998 | 1999 | 2000 | 2001 | 2002 | 2003 |
|---|---|---|---|---|---|---|---|---|---|
| Americans with Cellular Service (%) | 12.69 | 16.35 | 20.29 | 25.08 | 30.81 | 38.75 | 45.00 | 49.16 | 55.15 |
| Year | 2004 | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 | 2011 | 2012 |
|---|---|---|---|---|---|---|---|---|---|
| Americans with Cellular Service (%) | 62.852 | 68.63 | 76.64 | 82.47 | 85.68 | 89.14 | 91.86 | 95.28 | 98.17 |
- Let represent time in years starting with for the year 1995. Let represent the corresponding percentage of residents with cellular service. Use logistic regression to fit a model to these data.
- Use the model to calculate the percentage of Americans with cell service in the year 2013. Round to the nearest tenth of a percent.
- Discuss the value returned for the upper limit, . What does this tell you about the model? What would the limiting value be if the model were exact?
Solution.
Using the STAT then EDIT menu on a graphing utility, list the years using values 0–17 in L1 and the corresponding percentage in L2. Then use the STATPLOT feature to verify that the scatterplot follows a logistic pattern, as shown below:
Use the “Logistic” command from the STAT then CALC menu to obtain the logistic model,
Next, graph the model in the same window as the scatterplot to verify it is a good fit, as shown below:
To approximate the percentage of Americans with cellular service in the year 2013, substitute for the year in the model and solve for :
According to the model, about of Americans had cellular service in 2013.
The model gives a limiting value of about . This means that the maximum possible percentage of Americans with cellular service would be , which is impossible. (How could over of a population have cellular service?) If the model were exact, the limiting value would be and the model’s outputs would get very close to, but never actually reach . After all, there will always be someone out there without cellular service!
The table below shows the population, in thousands, of harbor seals in the Wadden Sea over the years 1997 to 2012.
| Year | 1997 | 1998 | 1999 | 2000 | 2001 | 2002 | 2003 | 2004 |
|---|---|---|---|---|---|---|---|---|
| Seal Population (Thousands) | 3.493 | 5.282 | 6.357 | 9.201 | 11.224 | 12.964 | 16.226 | 18.137 |
| Year | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 | 2011 | 2012 |
|---|---|---|---|---|---|---|---|---|
| Seal Population (Thousands) | 19.590 | 21.955 | 22.862 | 23.869 | 24.243 | 24.344 | 24.919 | 25.108 |
Letrepresent time in years starting withfor the year 1997, and letrepresent the number of seals in thousands. Use logistic regression to fit a model to that data.
Enter the year number in L1 and the population in L2, then run Logistic to find,, andfor.Use that model to predict the seal population for the year 2020 (). The model gives the population in thousands, so enter the number of seals, to the nearest whole seal.
about 25,634 sealsSubstituteinto the model you just found, then convert from thousands to a count.To the nearest whole number, what is the limiting value of that model, as a number of seals?
about 25,657 sealsThe limiting value is the constantin the numerator of the model.Key concepts
- Exponential regression is used to model situations where growth begins slowly and then accelerates rapidly without bound, or where decay begins rapidly and then slows down to get closer and closer to zero.
- We use the command “ExpReg” on a graphing utility to fit function of the form to a set of data points.
- Logarithmic regression is used to model situations where growth or decay accelerates rapidly at first and then slows over time.
- We use the command “LnReg” on a graphing utility to fit a function of the form to a set of data points.
- Logistic regression is used to model situations where growth accelerates rapidly at first and then steadily slows as the function approaches an upper limit.
- We use the command “Logistic” on a graphing utility to fit a function of the form to a set of data points.
Practice
Build an exponential model from data
The table below shows a set of data.
| 1 | 2 | 3 | 4 | 5 | 6 | |
|---|---|---|---|---|---|---|
| 1,125 | 1,495 | 2,310 | 3,294 | 4,650 | 6,361 |
Use the regression feature of a graphing calculator to find an exponential function of the formthat best fits the data in the table above.
Enter the-values in L1 and the-values in L2, then run ExpReg.The table below shows a different set of data.
| 1 | 2 | 3 | 4 | 5 | 6 | |
|---|---|---|---|---|---|---|
| 555 | 383 | 307 | 210 | 158 | 122 |
Exponential regression on the data above gives the model. Write this model as an equivalent exponential equation with base.
Write, so.Build a logarithmic model from data
The table below shows a set of data.
| 1 | 2 | 3 | 4 | 5 | 6 | |
|---|---|---|---|---|---|---|
| 5.1 | 6.3 | 7.3 | 7.7 | 8.1 | 8.6 |
Use the LOGarithm option of the REGression feature to find a logarithmic function of the formthat best fits the data in the table above.
Enter the-values in L1 and the-values in L2, then run LnReg.A logarithmic model is given by the equation. To the nearest hundredth, for what value ofdoes?
Isolate the logarithm, then exponentiate both sides.Logarithmic regression on a different data table,throughwithdown to, gives the model. Use that model to find the value of, rounded to the nearest tenth.
Substituteinto the model and evaluate.Build a logistic model from data
To the nearest whole number, what is the initial value of a population modeled by the logistic equation?
The initial value is.What is the carrying capacity of that same population model,?
The carrying capacity is the constant in the numerator, the model’s upper bound as.What is the-intercept on the graph of the logistic model? Enter your answer as an ordered pair.
Evaluate.The population of a koi pond over months is modeled by the function .
What was the initial population of koi in that pond?
4 koiThe initial population is.How many months will it take before there are 20 koi in that same pond? Round to the nearest tenth.
Setand solve forby isolating the exponential term.The population of an endangered species habitat for wolves is modeled by the function , where is given in years.
How many wolves will that habitat have after 3 years? Round to the nearest whole number.
about 38 wolvesEvaluate the model at.Use the intersect feature to approximate the number of years it will take before the population of that habitat reaches half its carrying capacity. Round to the nearest tenth.
The carrying capacity is 558, so set the model equal to 279 and solve for.This section is adapted from Precalculus 2e, Section 4.8: Fitting
Exponential Models to Data
by Jay Abramson and OpenStax, © OpenStax, licensed under
CC BY-NC-SA 4.0. Access
the original for free at openstax.org.
Changes: recreated every scatter plot and fitted-curve graph as an accessible
inline SVG built from its exact data and equation — the BAC/relative-risk
scatter and its exponential fit ; the
life-expectancy scatter and its logarithmic fit
; and the cellular-service scatter and its
logistic fit , whose
curve has no closed-form primitive in this site’s figure engine and is
therefore drawn as a dense polyline sampled directly from that exact
equation rather than any spline approximation. Every regression coefficient
printed on this page was independently re-derived — ordinary least squares
of against for each exponential model, of against for
each logarithmic model, and Nelder–Mead nonlinear least squares for each
logistic model — and matched the source’s published values to the precision
shown. Omitted the section’s one Media link to an external
graphing-calculator resource, which carries no transcribable mathematics.
Converted the three in-page Try Its (credit-card debt, video-game sales, and
harbor-seal population) into interactive fill-in components, each part of a
multipart Try It becoming its own component; converted eleven selected
end-of-section exercises — two exponential-model builds from data tables,
one logarithmic-model build plus two logarithmic evaluations, and six
logistic-model evaluations across three scenarios (a generic carrying-
capacity model, a koi pond, and a wolf habitat) — into interactive
fill-ins in a closing Practice block, one group per objective. Two exercises
whose end-of-section items depend on a graphing-calculator “intersect”
reading were given the underlying model directly in the question text so
each is answerable from the page alone. One upstream defect is corrected
here: the pinned CNXML’s solution to the Table 9 logarithmic-regression
exercise (module m49368, exercise id fs-id1650282) prints its fitted model
as , but the section’s own “LnReg” definition returns
, and reproducing the regression independently on the printed
data confirms the natural logarithm, not the common logarithm — this page’s
Practice block states the model with .