Question: Question 10 [4+4=8 points) Consider the dataset in Matlab obtained by typing load carsmall' in the command window. The dataset consists of observations on a

 Question 10 [4+4=8 points) Consider the dataset in Matlab obtained by

typing load carsmall' in the command window. The dataset consists of observations

Question 10 [4+4=8 points) Consider the dataset in Matlab obtained by typing load carsmall' in the command window. The dataset consists of observations on a fuel consumption metric MPG, which is the response of interest Y(x), and inputs such as Acceleration, Cylinders, Displacement, Model_Year, and Weight for a collection of cars. Let X1, X2, X3, X4, and X5 denote standardized versions of Acceleration, Cylinders, Displacement, Model_Year, and Weight respectively. Consider the regression model Yi = B1 + B2Xi1 + B3X iz + B4Xi3 + B5 Xi4 + B6%i5 + Ej, i = 1, ..., n, where E;~N(0, 02), i = 1, ..., n. We generate the model matrix M and the response vector y by removing the missing data from the dataset and standardizing the columns of M using the following code: 6 clear all load carsmall; D=[Acceleration, Cylinders, Displacement, Model_Year,Weight); y2=MPG; DED (isnan (MPG) ==0, :); n=size (D, 1); M=[ones (n,1).. (D-repmat ((min (D,[1,1) +max (D,[1,1))/2,n,1))./repmat (range (D, 1)/2,n,1)]; y=y2 (isnan (MPG) ==0); Note that information in this paragraph should be used to answer the sub-questions below unless stated otherwise. (a) Suppose the prior for (8,02) is given by 02~InvGamma(1,2(0.5)), and Blo2~Ny(Opx1, o2V), where V = 10016 (16 is the 6 x 6 identity matrix). Modify the Matlab code in page 30 of Chapter 6 (you need to change the prior parameters and use the Matlab commands given above to obtain the appropriate M and y) and then use it to calculate the 95% equal tail probability credible intervals for B1, ...,B6 and 02. Present the code and output of the code. (b) For this question, you will perform Bayesian variable selection using the model stated in page 36 of Chapter 6 and also select a model using the BIC criterion. Suppose dx = 81 = 1, de = 10-5, a = 1, b = 0.5, and g(y) 1. Modify the Matlab code in page 41 of Chapter 6. Then, use it to find the model that has highest posterior probability and the model that has the smallest BIC. Present the code and output of the code. Question 10 [4+4=8 points) Consider the dataset in Matlab obtained by typing load carsmall' in the command window. The dataset consists of observations on a fuel consumption metric MPG, which is the response of interest Y(x), and inputs such as Acceleration, Cylinders, Displacement, Model_Year, and Weight for a collection of cars. Let X1, X2, X3, X4, and X5 denote standardized versions of Acceleration, Cylinders, Displacement, Model_Year, and Weight respectively. Consider the regression model Yi = B1 + B2Xi1 + B3X iz + B4Xi3 + B5 Xi4 + B6%i5 + Ej, i = 1, ..., n, where E;~N(0, 02), i = 1, ..., n. We generate the model matrix M and the response vector y by removing the missing data from the dataset and standardizing the columns of M using the following code: 6 clear all load carsmall; D=[Acceleration, Cylinders, Displacement, Model_Year,Weight); y2=MPG; DED (isnan (MPG) ==0, :); n=size (D, 1); M=[ones (n,1).. (D-repmat ((min (D,[1,1) +max (D,[1,1))/2,n,1))./repmat (range (D, 1)/2,n,1)]; y=y2 (isnan (MPG) ==0); Note that information in this paragraph should be used to answer the sub-questions below unless stated otherwise. (a) Suppose the prior for (8,02) is given by 02~InvGamma(1,2(0.5)), and Blo2~Ny(Opx1, o2V), where V = 10016 (16 is the 6 x 6 identity matrix). Modify the Matlab code in page 30 of Chapter 6 (you need to change the prior parameters and use the Matlab commands given above to obtain the appropriate M and y) and then use it to calculate the 95% equal tail probability credible intervals for B1, ...,B6 and 02. Present the code and output of the code. (b) For this question, you will perform Bayesian variable selection using the model stated in page 36 of Chapter 6 and also select a model using the BIC criterion. Suppose dx = 81 = 1, de = 10-5, a = 1, b = 0.5, and g(y) 1. Modify the Matlab code in page 41 of Chapter 6. Then, use it to find the model that has highest posterior probability and the model that has the smallest BIC. Present the code and output of the code

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 Accounting Questions!