Question: By using Matlab: Longley data set. The Longley data set of labor statistics was one of the first used to test the accuracy of least

 By using Matlab: Longley data set. The Longley data set of

By using Matlab: Longley data set. The Longley data set of labor statistics was one of the first used to test the accuracy of least squares computations. You don't need to go to the NIST Web site to do this problem, but if you are interested in the background, you should see the Longley page at . The data set is available in NCM in the file longley.dat. You can bring the data into MATLAB with load longley.dat y longley(:,1) There are 16 observations of 7 variables, gathered over the years 1947 to 1962. The variable y and the 6 variables making up the columns of the data matrix are y = Total Derived Employ!nent. = GNP Implicit Price Deflater x2 Gross National Product, r3Unemployment, T4 = Size of Armed Forces, rs Noninstitutional Population Age 14 and Over, Zg=Year The objective is to predict y by a linear combination of a constant and the six r's: (a) Use the MATLAB backslash operator to compute A-a, ,As. This involves augmenting X with a column of all 1's, corresponding to the constant term. (b) Compare your 's with the certified values [3] (c) Use errorbar to plot y with error bars whose magnitude is the difference between y and the least squares fit. (d) Use corrcoef to compute the correlation coefficients for X without the column of 1's. Which variables are highly correlated? (e) Normalize the vector y so that its mean is zero and its standard deviation is one. You can do this with -mean(y); y/std(y) y = y y Do the same thing to the columns of X. Now plot all seven normalized vari- ables on the same axis. Include a legend By using Matlab: Longley data set. The Longley data set of labor statistics was one of the first used to test the accuracy of least squares computations. You don't need to go to the NIST Web site to do this problem, but if you are interested in the background, you should see the Longley page at . The data set is available in NCM in the file longley.dat. You can bring the data into MATLAB with load longley.dat y longley(:,1) There are 16 observations of 7 variables, gathered over the years 1947 to 1962. The variable y and the 6 variables making up the columns of the data matrix are y = Total Derived Employ!nent. = GNP Implicit Price Deflater x2 Gross National Product, r3Unemployment, T4 = Size of Armed Forces, rs Noninstitutional Population Age 14 and Over, Zg=Year The objective is to predict y by a linear combination of a constant and the six r's: (a) Use the MATLAB backslash operator to compute A-a, ,As. This involves augmenting X with a column of all 1's, corresponding to the constant term. (b) Compare your 's with the certified values [3] (c) Use errorbar to plot y with error bars whose magnitude is the difference between y and the least squares fit. (d) Use corrcoef to compute the correlation coefficients for X without the column of 1's. Which variables are highly correlated? (e) Normalize the vector y so that its mean is zero and its standard deviation is one. You can do this with -mean(y); y/std(y) y = y y Do the same thing to the columns of X. Now plot all seven normalized vari- ables on the same axis. Include a legend

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!