BU Covariance Matrix Linear Transformations & Standard Deviation Lab Report

User Generated

Uhtb123

Economics

Boston University

Description

Lab Assignment 1

1. Generate a covariate matrix X of dimension n × k, where n = 500 and k = 4. The first 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)0 and let σ 2 = 1. Simulate y from the model y = Xβ +ε, where ε ∼ N(0, σ2 In). Estimate β by ordinary least squares and report βˆOLS and the standard errors in a table. [Hint: the standard errors are computed by taking the square root of the main diagonal of s 2 (X0X) −1 , where s 2 is computed as discussed in class.] Also submit your computer code (this should not take more than 20 lines). For this exercise, the TAs will provide support on coding in Matlab (free on Apporto - see the link to VCL on Canvas), but you can use any software you are comfortable with. The idea behind this exercise is not to use packages or click on buttons, but to do the coding from scratch, following the theoretical derivations presented in class.

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Attached. Please let me know if you have any questions or need revisions.

Covariance matrix of dimension nxk
N= 500
K=4
C=1n−1n∑i=1(Xi−¯X)(Xi−¯X)T
Where our data set is expressed by the matrix following from this equation, the covariance
matrix can be c...


Anonymous
Awesome! Made my life easier.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags