Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: YSYY66
Economics 123B
Winter 2023
Lab Assignment 1
Due by 5 pm on Feb 3 rd , 2023
1. Generate a covariate matrix X of dimension n x k, where n = 500 and k = 4. The fi 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 .