MMEeconometricssoln

MMEeconometricssoln - 2011 - Steven Tschantz Econometrics...

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

View Full Document Right Arrow Icon
© 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 tschantz@math.vanderbilt.edu ± 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
Background image of page 1

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

View Full DocumentRight Arrow Icon
In[5]:= eqn3b = Mean @ xvector * yvector D ± beta1 * Mean @ xvector D + beta2 * Mean @ xvector * xvector D Out[5]= 1 5 H x1 y1 + x2 y2 + x3 y3 + x4 y4 + x5 y5 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 <D@@ 1 DD Out[6]= : beta1 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 - x1 y1 - x2 y2 - x3 y3 - x4 y4 - x5 y5 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 - - 1 25 H - x1 - x2 - x3 - x4 - x5 L H y1 + y2 + y3 + y4 + y5 L + 1 5 H - x1 y1 - x2 y2 - x3 y3 - x4 y4 - x5 y5 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 > On the other hand the sum of the squared errors is In[7]:= sse = Total @H yvector - H beta1 + beta2 * xvector LL ^2 D Out[7]= H - beta1 - beta2 x1 + y1 L 2 + H - beta1 - beta2 x2 + y2 L 2 + H - beta1 - beta2 x3 + y3 L 2 + H - beta1 - beta2 x4 + y4 L 2 + H - beta1 - beta2 x5 + y5 L 2 We minimize this by differentiating with respect to the
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 10/28/2011 for the course MATH 256 at Vanderbilt.

Page1 / 8

MMEeconometricssoln - 2011 - Steven Tschantz Econometrics...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online