1

DATASET y x1 x2 x3 x4 x5 x6 60323 83.0 234289 2356 1590 107608 1947 61122...

Question

DATASET y x1 x2 x3 x4 x5 x6 60323 83.0 234289 2356 1590 107608 1947 61122...

X are X1 = X3 = y Total Derived Employment, GNP Implicit Price Deflater, X2 Gross National Product, Unemployment, 24 Size of

DATASET

 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
X are X1 = X3 = y Total Derived Employment, GNP Implicit Price Deflater, X2 Gross National Product, Unemployment, 24 Size of Armed Forces, X5 Noninstitutional Population Age 14 and Over, Year. The objective is to predict y by a linear combination of a constant and the six x's: y aBo + Bkxk. 26 = 6 1 (a) Use the MATLAB backslash operator to compute Bo,B1, ..., B6. This involves augmenting X with a column of all l’s, corresponding to the constant term. (b) Compare your B’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 y = y mean(y); y = y/std(y) Do the same thing to the columns of X. Now plot all seven normalized vari- ables on the same axis. Include a legend.

Answers

`Hey,

Note: If you have any queries related to the answer please do comment. I would be very happy to resolve all your queries.

clc

clear all

close all

A=[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];

y=A(:,1);

L=[ones(size(A,1)),A(:,2:7)];

R=y(:);

disp('Coefficients are')

beta=L\R

err=abs(y-L*beta);

errorbar(y,err)

y=y-mean(y);

y=y/std(y);

figure;

hold on;

for i=2:7

x=A(:,i);

x=x-mean(x);

x=x/std(x);

plot(x,y);

end

legend('x1 vs y','x2 vs y','x3 vs y','x4 vs y','x5 vs y','x6 vs y')

MATLAB R2020a - academic use HOME FA Search Documentation Prad OOO Figure 1 File Edit View Insert Insert Tools Desktop Window

Kindly revert for any queries

Thanks.


Similar Solved Questions

1 answers
Maben Company was started on January 1, Year 1, and experienced the following events during its...
Maben Company was started on January 1, Year 1, and experienced the following events during its first year of operation: Acquired $29,000 cash from the issue of common stock. Borrowed $41,000 cash from National Bank. Earned cash revenues of $57,000 for performing services. Paid cash expenses of $49...
1 answers
A rotating generator has a square planar coil consisting of 100 turns. The coil rotates 60...
A rotating generator has a square planar coil consisting of 100 turns. The coil rotates 60 times per second in a magnetic field of 1.25 T and yields a peak output voltage of 300 V. What is the length of one side of the coil? A. 0.64 cm B. 8.0 cm C. 64 cm D. 80 cm E. 120 cm...
1 answers
Required information The following information applies to the questions displayed below.) Martinez Company's relevant range of...
Required information The following information applies to the questions displayed below.) Martinez Company's relevant range of production is 7,500 units to 12,500 units. When it produces and sells 10,000 units, its average costs per unit are as follows: Direct materials Direct labor. Variable ma...
1 answers
On January 1, 2021, Red Flash Photography had the following balances: Cash, $13,000; Supplies, $8,100; Land,...
On January 1, 2021, Red Flash Photography had the following balances: Cash, $13,000; Supplies, $8,100; Land, $61,000; Deferred Revenue, $5,100; Common Stock $51,000; and Retained Earnings, $26,000. During 2021, the company had the following transactions: 1. February 15 Issue additional shares ...
1 answers
The magnetic field inside an air-filled solenoid 35 cm long and 3.5 cm in diameter is...
The magnetic field inside an air-filled solenoid 35 cm long and 3.5 cm in diameter is 0.66 T. Part A Approximately how much energy is stored in this field? Express your answer to two significant figures and include the appropriate units. ni μΑ ? E = Value Units Submit Request Answer...
1 answers
Comparative Balance Sheets Consider the following balance sheet data for Great Buy Co, Inc, an electronics...
Comparative Balance Sheets Consider the following balance sheet data for Great Buy Co, Inc, an electronics and major appliance retailer, at February 26, 2013 and Februar 27, 2012 (amounts in thousands): Feb. 26, 2013 Feb. 27, 2012 $7,138 37,968 637,950 249,991 9,829 764,610 304,926 172,724 126,442 7...
1 answers
- Using the grammar in Example 3.2, show a parse tree and a leftmost derivation for...
- Using the grammar in Example 3.2, show a parse tree and a leftmost derivation for the following statement: B = C * (A * (B + C)). EXAMPLE 3.2 A Grammar for Simple Assignment Statements <assign> → <id> = <expr> <id> → A | B | C <expr> → <id> + <...
1 answers
Find T1 and T2. If the tension each rope can withstand is 800N, will they survive?...
Find T1 and T2. If the tension each rope can withstand is 800N, will they survive? Mi = 175 kg M2 = 154 kg Ti I wish I paid attention in physics T2 + M board = 15.0 kg 2.00 m 3.00 m 8.00 m...
1 answers
Question 3 3. Consider a plane pendulum consisting of a mass m suspended by a massless...
Question 3 3. Consider a plane pendulum consisting of a mass m suspended by a massless string of length I. Suppose that that time t-0 the pendulum is put into motion and the length of the string is shortened at a constant rate ot-a (ie. L(t)= Lo-at). Use the angle of the pendulum φ as your gene...
1 answers
Air at 300 K, 100 kPa in a rigid box is heated to 1000 K by...
Air at 300 K, 100 kPa in a rigid box is heated to 1000 K by a 1500 K source. a_ Find the final pressure. b_ Find the specific heat transfer. c_ Find the total entropy generation per kg air....
1 answers
What is the IRR of the following set of cash flows?    Year Cash Flow 0...
What is the IRR of the following set of cash flows?    Year Cash Flow 0 –$8,208             1 3,200             2 3,500       &nbs...
1 answers
Preparing a consolidated income statement—Cost method with noncontrolling interest, AAP and upstream and downstream intercompany inventory...
Preparing a consolidated income statement—Cost method with noncontrolling interest, AAP and upstream and downstream intercompany inventory profits A parent company purchased a 70% controlling interest in its subsidiary several years ago. The aggregate fair value of the controlling and noncontr...
1 answers
6. (10pls)For each biomedical application below, suggest an appropriate sensor or sensors that could be used...
6. (10pls)For each biomedical application below, suggest an appropriate sensor or sensors that could be used for this application. Briefly describe the sensing Block diagram by drawing a block diagram of the sensor (a) to diagnose whether a person has an arrhythmia and if yes, what type of arrhythmi...
1 answers
A firm produces two goods (the quantities of the two goods are denoted, Q1 and Q2). The demand fu...
A firm produces two goods (the quantities of the two goods are denoted, Q1 and Q2). The demand functions are Pi = 50-0.0075Q1 and P.-40-0.004Q2. Total cost is given by TC 19,800 + 20Q1 + 2002, Marginal costs are constant, so pricing at marginal costs results in a loss of the fixed costs for the firm...
1 answers
Thank you! = v 552 SED AaBbCcI AaBbci AaBbci AaBbCcl 1 Normal 1 No Spac... Heading...
Thank you! = v 552 SED AaBbCcI AaBbci AaBbci AaBbCcl 1 Normal 1 No Spac... Heading 1 Heading 2 Paragraph Styles 1. Identify the types of intermolecular forces that would be present in a pure sample of each substance for the following pairs of molecules. It may help to draw Lewis structures in som...
1 answers
2. A multivitamin tablet contains 2.53 x 107 mole of chromium. How many milligrams of chromium...
2. A multivitamin tablet contains 2.53 x 107 mole of chromium. How many milligrams of chromium does each tablet contain?...
1 answers
A Styrofoam bucket of negligible mass contains 1.55 kg of water and 0.435 kg of ice....
A Styrofoam bucket of negligible mass contains 1.55 kg of water and 0.435 kg of ice. More ice, from a refrigerator at -15.0 ∘C, is added to the mixture in the bucket, and when thermal equilibrium has been reached, the total mass of ice in the bucket is 0.772 kg . Assuming no heat exchange with...
1 answers
The production function for widgets takes the following form: q = 4L + 6K a. What...
The production function for widgets takes the following form: q = 4L + 6K a. What is the least cost combination of L and K that the firm should employ to produce 48 widgets when w = 2 and r = 4. b. Suppose the price of labor increases to w = 4 but the rental rate of capital is unchanged. If the firm...
1 answers
A)Why the moment of inertia is defined with respect to a specific rotation axis? in? b)...
a)Why the moment of inertia is defined with respect to a specific rotation axis? in? b) Why the angular acceleration is related to tangential accelerations and not to the centripetal acceleration, explain?...

-- 0.009828--