Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

The amount of work I am asked to do is reasonable.

Answered: 1 week ago

Question

The company encourages a balance between work and personal life.

Answered: 1 week ago