Professional Documents
Culture Documents
Given
Personal income data for years after 1950, in billions.
In[43]:=
data
Transpose 10, 20, 30, 40, 50, 55 , 411.5, 838.8, 2307.9, 4878.6, 8429.7, 10 239.2
Find
A) Write the equation of a power function model for the data B) Predict personal income for the year 2010 C) Find the best-fit quadratic function D) Which model is the best fit for the data? Why?
Solution
A) Power Function Model A power function is of the form y=a*x^b, where and are the parameters of interest. It will plot as a straight line a b on log-log paper. That is log[y] = log[a] + b*log[x] A plot of this data on a log-log scale shows the first data point to be an outlier.
8
Out[82]=
We can find the exponent by considering only the second point and the last point. b
In[47]:=
data
Out[48]=
And we can find the multiplier by matching the value of the last data point. a
In[87]:= Out[87]=
Reduce a data
6, 1
^b
data
6, 2
, a, Reals
0.507929
0.507929 x2.47331
CMMQ.nb
12 000
10 000
8000
Out[56]=
6000
4000
2000
20
30
40
50
60
f 60
12 697.8
The model predicts personal income in 2010 to be 12.7 trillion dollars. C) Quadratic Function Fit The Wikipedia article on polynomial regression (http://en.wikipedia.org/wiki/Polynomial_regression) gives a formula for the coefficients of the polynomial model y = a0 a1 x a2 x2 x0 We can start by defining the matrix X a XXT
1
Xy
For the given values of x, i.e. 10, 20, 30, ..., 55, this reduces to
Out[94]=
q x
830.814
94.8252 x
4.87507 x2
The predicted value for 2010 is not so different from that given by our power function model, 12.7 trillion dollars.
Out[103]=
q 60
12 691.6
D) Best Model for the Data Perhaps the fit to the data can best be seen on the log-log graph we started with. The additional degree of freedom in the quadratic model allows it to come closer to more data points. The blue line is the quadratic model, and the points shown are the original data.
CMMQ.nb
Out[100]=
2.5
3.0
3.5
4.0