Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Least squares using MatLab, I have provided the data as well Data: y x1 x2 x3 x4 x5 x6 60323 83.0 234289 2356 1590 107608

Least squares using MatLab, I have provided the data as well

image text in transcribed

Data: y x1 x2 x3 x4 x5 x6 60323 83.0 234289 2356 1590 107608 1947 61122 88.5 259426 2325 1456 108632 1948 60171 88.2 258054 3682 1616 109773 1949 61187 89.5 284599 3351 1650 110929 1950 63221 96.2 328975 2099 3099 112075 1951 63639 98.1 346999 1932 3594 113270 1952 64989 99.0 365385 1870 3547 115094 1953 63761 100.0 363112 3578 3350 116219 1954 66019 101.2 397469 2904 3048 117388 1955 67857 104.6 419180 2822 2857 118734 1956 68169 108.4 442769 2936 2798 120445 1957 66513 110.8 444546 4681 2637 121950 1958 68655 112.6 482704 3813 2552 123366 1959 69564 114.2 502601 3931 2514 125368 1960 69331 115.7 518173 4806 2572 127852 1961 70551 116.9 554894 4007 2827 130081 1962
4. Longley data set. The Longley data set of labor statistics was one of the first used to test the accuracy of least squares computations The dataset is available at https://www.itl.nist.gov/div898/strd/lls/11s.shtml. 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 X are y-Total Derived Employment r1 GNP Implicit Price Deflater 2 Gross National Product r3 Unemployment r4 Size of Armed Forces, r5 Noninstitutional Population Age 14 and Over r6 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 d's with the NIST certified values (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 - y - mean (y); y y y / std(y) Do the same thing to the columns of X. Now plot all seven normalized variables on the same axis. Include a legend. 4. Longley data set. The Longley data set of labor statistics was one of the first used to test the accuracy of least squares computations The dataset is available at https://www.itl.nist.gov/div898/strd/lls/11s.shtml. 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 X are y-Total Derived Employment r1 GNP Implicit Price Deflater 2 Gross National Product r3 Unemployment r4 Size of Armed Forces, r5 Noninstitutional Population Age 14 and Over r6 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 d's with the NIST certified values (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 - y - mean (y); y y y / std(y) Do the same thing to the columns of X. Now plot all seven normalized variables on the same axis. Include a legend

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

Students also viewed these Databases questions

Question

Discuss psychosocial factors important in pregnancy outcomes.

Answered: 1 week ago