Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hint: It is totally fine to take a similar strategy as part (c), but if you think a little outside the box, there might be
Hint: It is totally fine to take a similar strategy as part (c), but if you think a little outside the box, there might be an easier way of getting to these results based on the results of part (c). (f) Lets use an example and see if the result you got in part (c) can also be obtained in R via the Im function (feel free to use Python for linear regression if you are more comfortable). For this purpose assume that n = 10 and our data are as follows: 21 22 Y 89.0900 78.4800 113.2700 84.2400 70.5600 109.7700 98.7700 93.5200 130.0800 95.4400 86.7200 120.4500 90.9800 79.2000 115.0900 97.3900 91.3600 125.3700 89.2700 80.0000 116.2200 88.5100 76.9600 112.0800 97.0600 92.5600 127.8500 84.4500 66.4000 107.6100 Write a program that takes the data as indicated in the table and calculates the values of , and 2 as suggested in part (c). Attach the code and results. (g) Write a program that takes the data as indicated in the table and calculates the values of 1 and B2 using the linear model function in R (or Python). If you write your program correctly, you should get identical results as part (f). Attach the code and results. Hint: When you use the Im command in R, you need to somehow enforce the intercept to be zero. Q2. The goal of this question is to mathematically show that for linear models the expected mean squared error (MSE) for the training is always less than the expected mean squared error for the test data. While the idea of proof in general is similar to what we will do, to avoid complications, lets work with a simple model. (a) Suppose that the God's model is y = f*c and our observations are in the form of y = f*c+, where e is a zero mean noise with variance o?. Consider a training set of size n, as (21, y), (x2, y2), ..., (2n, Yn). We define the training MSE function as (b) Suppose that is obtained by minimizing the MSE associated with the training data. Mathemat- ically, or in simple words, discuss why we should have M() = M(B*). (6) (-) I do this part for you. We know that if for two random variables u and v we always have u sv, then we also have E(u)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started