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 = β0 +β1x + β2x2 , and plot your estimates for β0, β1, and β2 as N increases, together with a line indicating their true values. Supply your code.