{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

MMEeconometricssoln

MMEeconometricssoln - 2011 Steven Tschantz Econometrics...

This preview shows pages 1–3. Sign up to view the full content.

© 2011 - Steven Tschantz Econometrics Luke Froeb and Steven Tschantz 3/29/11 Exercises Complete the following exercises. You can save a copy of this notebook, delete the material above, insert and evaluate your commands computing answers below, save your results, and email your final version to [email protected] 1. Suppose we want to fit a linear model y = Β 1 + Β 2 x + Ε for constants Β 1 and Β 2 and a random disturbance term Ε , to samples H x i , y i L for i = 1, ..., n . The analysis above suggests solving the equations (3) with the expectations involving the disturbance term taken to be zero. Show that this gives the same parameters Β 1 and Β 2 which minimize the sum of the squares of the errors SSE = i = 1 n H y i - H Β 1 + Β 2 x i LL 2 and illustrate that this gives the same as the Fit command, at least for a particular numerical list of pairs. You may use Mathematica to do some of the calculation for you if you take a particular n , say n = 5, and symbolic x i and y i such as In[1]:= data = 88 x1,y1 < , 8 x2,y2 < , 8 x3,y3 < , 8 x4,y4 < , 8 x5,y5 << ; In[2]:= xvector = data @@ All,1 DD Out[2]= 8 x1,x2,x3,x4,x5 < In[3]:= yvector = data @@ All,2 DD Out[3]= 8 y1,y2,y3,y4,y5 < Unfortunately, the Fit command doesn't work with symbolic values, so for the last step generate your own table of random points, say starting from a linear relationship between x and y with random noise added, and then check that the formulas for Β 1 and Β 2 agree with the result of Fit. Equations (3) are two equations in this case, one for j = 1 with a constant input variable and one for j = 2 with the x as the input variable. These two equations are In[4]:= eqn3a = Mean @ yvector D beta1 + beta2 * Mean @ xvector D Out[4]= 1 5 H y1 + y2 + y3 + y4 + y5 L beta1 + 1 5 beta2 H x1 + x2 + x3 + x4 + x5 L

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
In[5]:= eqn3b = Mean @ xvector * yvector D beta1 * Mean @ xvector D + beta2 * Mean @ xvector * xvector D Out[5]= 1 5 H x1y1 + x2y2 + x3y3 + x4y4 + x5y5 L 1 5 beta1 H x1 + x2 + x3 + x4 + x5 L + 1 5 beta2 I x1 2 + x2 2 + x3 2 + x4 2 + x5 2 M The solution for Β 1 and Β 2 according to this method is In[6]:= eqn3solns = Solve @8 eqn3a,eqn3b < , 8 beta1,beta2 1 DD Out[6]= : beta1 fi y1 5 + y2 5 + y3 5 + y4 5 + y5 5 + x1 5 + x2 5 + x3 5 + x4 5 + x5 5 - 1 25 H - x1 - x2 - x3 - x4 - x5 L H y1 + y2 + y3 + y4 + y5 L + 1 5 H - x1y1 - x2y2 - x3y3 - x4y4 - x5y5 L - 1 25 H - x1 - x2 - x3 - x4 - x5 L 2 + 1 5 I x1 2 + x2 2 + x3 2 + x4 2 + x5 2 M ,beta2 fi - - 1 25 H - x1 - x2 - x3 - x4 - x5 L H y1 + y2 + y3 + y4 + y5 L + 1 5 H - x1y1 - x2y2 - x3y3 - x4y4 -
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 8

MMEeconometricssoln - 2011 Steven Tschantz Econometrics...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online