Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Economics 123B

Winter 2023

Lab Assignment 1

Due by 5pm on Feb 3rd, 2023

1.  Generate a covariate matrix X of dimension n x k, where n = 500 and k = 4. The rst column in X should be a column of ones and the other three columns can be generated from a relatively diffuse normal or uniform distribution.  Let β = (1, 1.25, 1.5, 1.75)\  and let σ 2  = 1.  Simulate y from the model y = Xβ + ε, where ε ~ N (0, σ2 In).  Estimate β by ordinary least squares.  Report βˆ0Ls  and the standard errors of βˆ0Ls . Also submit your computer codes.

For this exercise, the TA has provided support on coding in MATLAB (free on Apporto at https://uci.apporto.com/), but you can use any software you are comfortable with. The idea behind this exercise is not to use statistical packages or click on buttons, but to do the coding from scratch, following the theoretical derivations presented in class. Deriving βˆOLS and its standard errors by using statistical packages will result in 0 points.