ECMT3110-matlab代写
时间:2023-05-13
ECMT3110: Computational Assignment
Due: May 21, 11:59pm
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.
You may work on this assessment individually, or in pairs. If you work in
pairs, it is important that you clearly indicate the student ID number of your
partner in your submission.
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
1 Question
Consider the following linear regression model:
Y = β0 + β1X1 + β2X2 + β3X3 + u. (1)
Let β0 = 1, β1 = 0.5, β2 = 0.1, and β3 = 2. Let the joint distribution of X1,
X2, X3, and u be
X1
X2
X3
u
 ∼ N (µ,Ω) with µ =

1
1.5
0
0
 and Ω =

3 1.5 1 0
1.5 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 X1, X2, X3, and u. Compute Y using
Model (1) and the simulated values of X1, X2, X3, and u. Calculate the
OLS estimator of β = (β0, β1, β2, β3)
>. Repeat this exercise for sample
sizes of 20, 30, 40, 50, 100, 200. Plot your estimates of β1 as a function of
n. What can you conclude from your graph?
2. Use simulation to check if the error term u satisfies the homoskedasticity
assumption. For example, you can use simulation to approximate the
conditional variance of u conditioning on X = (X1, X2, X3)
>. Report
your result.
3. Assume homoskedasticity. Let n = 10. Use the simulated samples to
estimate σ2, where σ2 = E
(
u2 | X), and report the value. What is true
value of σ2? Repeat this exercise for sample sizes of 20, 30, 40, 50, 100, 200.
Plot your estimates of σ2 as a function of n. What can you conclude from
your graph?
4. We have learned that V ar
(
β̂ | X
)
= σ2
(
X>X
)−1. For n = 10, 20, 30, 40, 50, 100, 200,
use simulation to compute the unconditional variance of β̂: V ar
(
β̂
)
. Plot
it as a function of n. What do you learn from the graph?
5. Given any set of observations, rather regressing Model (1), we can estimate
β1, β2, β3 by regressing the demeaned Y on the demeaned X. (Note that
such a regression does not contain a constant term. Hence, no β0 will be
estimated) Simulate a set of observations to show this.


essay、essay代写