Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Solve parts (d) and (e) and provide detailed comments asap. NOTE: DONOT COPY FROM PREVIOUSLY POSTED QUESTION, These parts are done wrong in that.

Please Solve parts (d) and (e) and provide detailed comments asap.

NOTE: DONOT COPY FROM PREVIOUSLY POSTED QUESTION, These parts are done wrong in that.

image text in transcribedimage text in transcribedimage text in transcribed
\f{h} Suppose a linear regression was tted on these data. The estimated model is Y = 2 use; + 2.51}, where \"if is the predicted (or expected} value of Y, K1 and X: are the observed values of the colurnm X1 and X2. Design a Python program to compute li' for everyr row of the array.r and store the results in a separate I"~Itim.l\"j,.r arra},r as well. (5 marks) {e} The residuals of the model E are calculated by: =YP where Y is the actual value stored in the original liltru'ini.r array.r and 'i' is the predicted value of Y computed in [h]. Use a Python program to compute e for even.r row of the array.r and store the results in a separate Numl'yr array. (5 marks} {d} One of the main assumptions for linear regression is that the residuals must he normally distributed with zero mean and constant variance. Create a histogram of the residuals calculated in {c} by using the matplotlih package. Adjust the parameters of the chart so that the ticks on the x-axis can he read clearly, a title is given to the chart, and both the axes are labelled. Eventually, discuss whether you agree that the normality assumption with zero mean {the checking of constant variance is not required here} is valid based on this histogram. [ll] marks} {e} The constant variance assumption can be checked by a scatter plot in which the x-axis represents the values of the predicted values '1' and the y-axis represents the residuals e. If the scatter plot does not show any pattern and the values of all the data points are more or less on the same level. Write a Python program to create such a scatter plot for checking the constant variance assumption. Adjust the parameters of the chart so that the ticks on both axes can he read clearly, a title is given to the chart, and both the axes are labelled. Eventually, discuss whether you agree that the constant variance assumption is valid based on this scatter plot.

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

1.4. What distinguishes the short run from the long run? (LO11-2)

Answered: 1 week ago