Question: For this question, you have to simulate some datasets. Let s assume the outcome Y depends linearly on 4 0 covariates X 1 , X

For this question, you have to simulate some datasets. Lets assume the outcome Y depends linearly on 40 covariates X1,X2,...,X40. The relationship is given by the following equation: Y =\beta 0+\beta 1X1+\beta 2X2++\beta 40X40+(1) (a)[8 Marks] Perform the following simulations. Generate training sets of size 50 as follows: Generate 50 random values for all X variables from a standard normal distribution. That is, X1 N(0,1),X2 N(0,1),...,X40 N(0,1). Generate also from a standard normal distribution: N(0,1). Generate \beta values from a Uniform distribution where \beta 1 to \beta 20 are simulated from Uniform(0.5,1.5) and \beta 21 to \beta 40 are simulated from Uniform(0.1,0.4). You can choose any arbitrary value for \beta 0. Then generate Y using (1). Note: You cannot use a for loop for this data generation. If you use a for loop, you will receive a zero for this section. Generate a test set of size 1000 as follows: Generate 1000 random values for all X variables from a standard normal distribution. That is, X1 N(0,1),X2 N(0,1),...,X40 N(0,1). Generate also from a standard normal distribution: N(0,1). Use the same \beta values generated for the training set. Then generate Y using (1). Note: You cannot use a for loop for this data generation. If you use a for loop, you will receive a zero for this section.

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