Creating Models From Data

So far we have studied how to find a linear equation or exponential equation if we are given some initial value and a rate of change (absolute or relative). Often times you have a set of points (data) for which you want to create a model which best represents those points. The only models we have studied in this class are linear and exponential. Many times a much more complicated model is needed to do the job. Here we will only consider the linear and exponential models.

Creating a formula for a linear model

To create a linear equation we need to find the slope and the intercept (rate of change and the initial value). The first thing to do is to plot the data as points. Remember linear equations have graphs which are lines. Often the points will not fall exactly on a line, but if it looks like a line is a ``good approximation'' to a graph representing those points, then a linear model may be appropriate.

Once you have a plot of the points and have decided that a linear model is appropriate, we need to find the model. You want a line which best approximates all the points. Recall that if you knew two points on the line you could calculate the line that passes through them (calculate the slope and then solve for $initial$ in $y=slope*x +
intial$ where $(x,y) = (independent,dependent)$ using one of the points on the line for $x$ and $y$). The line that best approximates the data points will not always pass through all of the points, or any of them. Therefore you cannot simply pick two data points and calculate the line passing though them. You want to draw a line on your plot which best represents your points, which will will call the ``best fit line''. You may want to draw a few lines to try to get what appears to be the best fit. (note: there are statistical methods to determine this line, but this is beyond the scope of this class. We will stick to drawing a line which looks best.)

Once you have drawn the best fit line you need to determine its equation. We need to determine the slope and the intercept. It is important that you make this plot on graph paper and scale your axes so that you get the best precision possible on your graph. Look for two points on the graph of the line which are exactly on your best fit line. These points do not have to be data points. You want two points for which you can read their coordinates as accurately as possible. Use the graph paper, and record the coordinates of the points. Now you have two points, and you can get the equation. Sometimes the intercept will appear on your graph, and other times your points are too far away from the vertical intercept to be able to read it from the graph. If the intercept is available, choosing it as one of your points makes determining the equation much easier.

Creating a formula for a exponential model

Creating an exponential model is not as straightforward as creating a linear model. You cannot simply look at a plot and draw a ``best fit'' exponential curve. You should still begin by making a plot of your points. This will help you decide if an exponential model is appropriate.

Let's call the dependent variable $t$ and the independent variable $Q$. If you think that an exponetial equation models the data, make a plot of $\log(Q)$ vs. $t$. This is called a log plot. If there is an exponential relationship, this graph should be a line. (see below)
$Q=Q_o(1+r)^t$
$\log(Q) = \log[Q_o(1+r)^t]$ [Here we use the rule: $\log(a*b) = \log(a) + \log(b)$]
$\log(Q) =
\log(1+r)^t + \log(Q_o)$
$\log(Q) = t\log(1+r) + \log(Q_o)$
Let $slope=log(1+r)$ and $initial=\log(Q_o)$, and this becomes the equation $\log(Q)=slope*t+initial$.

You have reduced the problem to finding a linear equation. On the log plot, draw the best fit line as you would for a linear model. Calculate the slope and intercept from your graph (see liner model section). Finally you need to calculate the values for the initial value and rate of change for your exponential equation ($r$ and $Q_o$). Solve for $r$ and $Q_o$ and get $r=10^m-1,~~Q_o =
10^b$. (Recall how to undo a log, $10^{\log(y)}=y$)

Deciding whether to use a linear or exponential model

Sometimes just looking at a plot of the data is not enough to decide which model is more appropriate. Some knowledge of what your data means, or statistics may help you make the decision. However we will not do this for this class. I suggest looking at both the plot of the data and the log plot of the data. Decide which one looks more like a straight line. If your original data is linear, the log plot should look curved downward. If you original data is exponential, your log plot should look like a straight line, and your original data should looked curved upward. However sometimes it is not clear that one model is better than the other. On the graph below it is unclear whether it is linear or exponential.




\epsfig {file=pop.ps, height=5cm}




Homework

  1. If you submerge your face in cold water, your heart rate will drop. Suppose you tried submerging your face in 8 different water temperatures and measured your change in heart rate. A table is given below. Make a plot of the data, and draw the best fit line. Then determine the equation of the line. Write a sentence to describe what the slope of this line means.

    degrees F beats/min
    68 2
    65 5
    70 1
    60 9
    55 13
    58 10
    65 3
    63 6

  2. Find an exponential equation to fit the data given
    t Q
    -10 3.22
    2.3 10
    5 17.62
    7.5 23.5
    20 96.46

  3. Below you are given the plots of two data sets (figures 1 and 3) and their log plots (figures 2 and 4). Decide for each data set if a linear or exponential curve is better. (See hand-out for fiures.)

Other homework
  1. The population of a town was 35,000 in 1981 and is 75,000 today. If the growth was exponential. Find the growth rate per yer. What would the population be in 2025?

  2. Suppose the number of killer bees in the U.S. is five times the number there were 20 years ago. Assuming that the amount grew exponentially, what percent did it increase each year?

  3. If your bank account grows with a daily interst rate of .016%, what is the APY?