ECMT3110-无代写
时间:2024-04-24
ECMT3110: Computational Assignment
Due: May 5, 11:59pm
April 22, 2024
This assessment task requires you to write a program to investigate the
properties of econometric estimators. You can use any software that you are
familiar with, such as Matlab, R, Python, etc. Some of the questions may
require knowledge that is beyond the scope of this class. You can use all the
resources available online to solve them.
Your submission should consist of two files: a PDF containing typed answers
to each question, and a file containing the code you have used to obtain your
results. Your code needs to be ready to run. Points will be deducted if the code
cannot be run. You should include comments in your code to make it easily
understandable. Submit your files through the Canvas course website.
The assignment is worth a total of 25 points towards your final assessment.
1 Question
Consider the following linear regression model:
Y = β1 + β2X2 + β3X3 + β4X4 + u. (1)
Let β1 = 0.5, β2 = 0.5, β3 = 1, and β4 = 2. Let the joint distribution of X2,
X3, X4, and u be
X2
X3
X4
u
 ∼ N (µ,Ω) with µ =

1
2
−1
0
 and Ω =

2 1 1 0
1 1 0 0
1 0 4 0
0 0 0 2
 ,
where N (µ,Ω) denotes the joint Normal distribution with µ and Ω being the
mean and variance-covariance matrix of the Normal distribution.
1. Simulate n = 10 observations of X ≡ (X2, X3, X4) and u. Compute Y
using Model (1) and the simulated values of X and u. Calculate the OLS
estimator
β̂ ≡
(
β̂1, β̂2, β̂3, β̂4
)
.
2. Using the simulated values of X and Y to numerically show that PXY is
orthogonal to MXY , and that
‖Y ‖2 = ‖PXY ‖2 + ‖MXY ‖2 .
1
3. Numerically show the FWL theorem. For example, you can show that the
theorem applies to β̂2.
4. Repeat Question 1 five hundred times. Then you will obtain five hundred
estimators, denoted as β̂3,1, β̂3,2, . . . , β̂3,500. Compute the mean squared
error (MSE) as
MSEn=10 =
1
500
500∑
b=1
(
β̂3,b − β3
)2
.
5. Repeat Question 4 for sample sizes of 20, 30, 40, 50, 100, 200. Now you will
have MSEn=20,..., MSEn=200. Plot them as a function of the sample
size. What can you conclude from your graph? What theorem does your
conclusion relate to?
6. Given any set of observations, rather regressing Model (1), we can es-
timate β2, β3, β4 by regressing the demeaned Y on the demeaned X ≡
(X2, X3, X4). (Note that such a regression does not contain a constant
term. Hence, no β1 will be estimated) Simulate a set of observations to
show this.
7. What is the central limit theorem? Can you apply the central limit the-
orem to obtain the asymptotic distribution of

n
(
β̂3 − β3
)
? (For this
question, we can search for answers on the Internet.)
8. Numerically show that the central limit theorem holds for Model (1). For
example, you can show that the difference between

n
(
β̂3 − β3
)
and its
asymptotic distribution becomes smaller and smaller when n increases.
essay、essay代写