Exponential Fit

Of course, in almost all of your math courses, you have probably heard that population growth can best be modeled by an exponential growth function.  This makes sense (or we have told you it does), but is it true?

Unfortunately, fitting data to an exponential growth equation [Graphics:../Images/index_gr_25.gif] takes a little more work in Mathematica.  To do this, first notice that [Graphics:../Images/index_gr_26.gif] for some constant [Graphics:../Images/index_gr_27.gif].  Thus, [Graphics:../Images/index_gr_28.gif].  So, in other words, the natural log of y is a line for exponential growth.  

So, our technique will be the following:
1)  Take the natural log of all the y values (the population).
2)  Fit those log's to a line, using the Fit function.
3)  Exponentiate that line to get back to population (i.e., to "cancel out" the log's we took in part 1).

Take the log of all the population data

1) Taking the natural log of all of our population data is a little tricky.We want to define a new data set whose first coordinate for each point is the year,but whose second coordinate itLog(population)(a reminder:Mathematicauses Log for the natural log,ln).In a list of data,you can access different elements of that list using the "double-bracket" notation:

[Graphics:../Images/index_gr_29.gif]
[Graphics:../Images/index_gr_30.gif]
[Graphics:../Images/index_gr_31.gif]
[Graphics:../Images/index_gr_32.gif]

What we really need to access is the set of all populations.  One way to do this is to take the Transpose of the populationData:

[Graphics:../Images/index_gr_33.gif]
[Graphics:../Images/index_gr_34.gif]

Now, the first element contains all the years:

[Graphics:../Images/index_gr_35.gif]
[Graphics:../Images/index_gr_36.gif]

And the second element contains all the populations (in the correct order):

[Graphics:../Images/index_gr_37.gif]
[Graphics:../Images/index_gr_38.gif]

One particularly cool trick in Mathematica is that you can take the natural log of all of these at one time:

[Graphics:../Images/index_gr_39.gif]
[Graphics:../Images/index_gr_40.gif]

Of course, after we finish, we need to Transpose the data back into the original form (so each element contains a year and a population).  This can all be combined together into the following command:

[Graphics:../Images/index_gr_41.gif]
[Graphics:../Images/index_gr_42.gif]

Fit the log's to a line

2)  Fit the log's of the population to a line.  This is easy:

[Graphics:../Images/index_gr_43.gif]
[Graphics:../Images/index_gr_44.gif]

Eponentiate the result

3)  And finally, we exponentiate the result to get back to the actual population (instead of the log of the population):

[Graphics:../Images/index_gr_45.gif]
[Graphics:../Images/index_gr_46.gif]
[Graphics:../Images/index_gr_47.gif]

[Graphics:../Images/index_gr_48.gif]

[Graphics:../Images/index_gr_49.gif]
[Graphics:../Images/index_gr_50.gif]

[Graphics:../Images/index_gr_51.gif]

[Graphics:../Images/index_gr_52.gif]

This doesn't seem terribly unreasonable either.


Converted by Mathematica      May 11, 2003