Fit a linear regression model and plot your estimates


Simulate N = 104 outcomes from the model

Y = -2 + X -X2 + ε

where X ~ U[0, 1] and ε ~ N(0, 0.12) independently. From your simulated outcomes of (X, Y ).

(a) Fit a linear regression model as in Q5, and plot your estimates for β0 and β1 as N increases, together with a line indicating their true values. Supply your code.

(b) Fit a quadratic regression model y = β01x + β2x2 , and plot your estimates for β0, β1, and β2 as N increases, together with a line indicating their true values. Supply your code.

Solution Preview :

Prepared by a verified Expert
Mathematics: Fit a linear regression model and plot your estimates
Reference No:- TGS0688728

Now Priced at $10 (50% Discount)

Recommended (96%)

Rated (4.8/5)