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.
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...
Review
Review
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Similar Content
Related Tags
Into Thin Air
by Jon Krakauer
To Kill a Mockingbird
by Harper Lee
Persuasion
by Jane Austen
The Metamorphosis
by Franz Kafka
Big Little Lies
by Liane Moriarty
The Picture of Dorian Gray
by Oscar Wilde
The Sun Is Also a Star
by Nicola Yoon
Too Much and Never Enough
by Mary L. Trump
Tess of the DUrbervilles
by Thomas Hardy