Computational Economics ECON 457 - A01
University of Victoria
Department of Economics
ECON 457
Computational Economics
Spring Term 2020/21
Instructor:
Marco Cozzi
Take Home Exam1
April 24 th 2021
Due on Brightspace before 11.59pm April 25 th 2021
You must create and submit a pdf file, making sure that it’s readable and unlocked.
The file name must follow this template: 457 Final Surname Name StudentNumber.pdf
Instructions:
• You are asked to work by yourselves on each question. UVic’s rules about cheating and plagiarism
apply also to this exam.
• I will check carefully both the answers and the related codes, to be sure that no cooperation among
students took place.
• Type your name, student number and the date on the front page of your answers.
• On the front page of your answers, you must also type the following statement: “I (type in your name)
acknowledge that I understand the exam rules and that I will not give or receive any aid on this exam
and that all work will be my own”.
• The exam consists of two questions: you have to answer both. The total number of marks is 100.
• Question 1 is worth 40 marks, while Question 2 is worth 60 marks.
• Answer clearly and concisely. Devote some time to give the graphs, plots and tables a format easy to
understand. Also the way you present your answers matters for the final grade.
• Use a version of Python installed on your computer. Since the https://uvic.syzygy.ca/ server is unre-
liable when several users are trying to access it at the same time, do not use it.
• Please create a pdf file with your answers and submit it before the deadline. In your document, you
must include the codes you have used to generate your results.
• Tables and graphs must be clearly labeled and referenced in the text.
• No late submissions will be accepted.
• I will not provide suggestions on how to solve the questions, or feedback on the quality of your answers.
• Students requesting to view their final exams must do so in writing, and must request a review within
one week of the grades being posted.
1The material contained in this document is copyrighted c©, property of the University of Victoria, meant exclusively for
the use of students enrolled in ECON 457, and it cannot be shared without the author’s explicit consent.
Page 1 of 5
Computational Economics ECON 457 - A01
Question 1: Spurious Regressions and Ordinary Least Squares (40 Marks)
Consider the classical linear econometric model. We analyze some properties of the Ordinary Least
Squares (OLS) estimator when the variables are non-stationary. We will rely on Monte Carlo simulation
methods. In terms of notation, the index t = 1, ..., T denotes the time period in our (simulated) series, and
T is the sample size. As the initial seed number, use your date of birth (e.g., if you were born on April the
13th, use the number 13 as the seed).
(a) Set the sample size to T = 100. First consider two independent error terms, uxt and u
y
t , both drawn
from the standard normal distribution. Then generate the explanatory variable (xt) and the error term (et)
in the equation that generates the dependent variable (yt). As initial values, use x0 = 0 and e0 = 0. For
every data point, you are asked to generate the sample using the following model, setting the true parameter
value to β = 0.7:
xt = xt−1 + uxt
et = et−1 + u
y
t
yt = βxt + et
(a.1) Compute the sample average and the sample standard deviation of both xt and yt. Comment.
(a.2) Compute βˆOLS , the OLS estimate for β. Comment. You can find the relevant formulas here:
https://en.wikipedia.org/wiki/Simple linear regression
(a.3) Now set the seed to a new value, using the formula:
seed=seed+100
Create the new values for xt and yt using the same procedure as above. Redo parts (a.1) and (a.2).
Comment.
(a.4) Now reset the seed to its original value, and set the sample size to T = 10, 000. Create the new
values for xt and yt using the same procedure as above. Redo parts (a.1) and (a.2). Comment on how the
results are affected by the sample size.
(a.5) Set the sample size to T = 100. Create 500 different datasets, using a do-loop and setting the seed
to seed=seed+iter, where iter stands for the iteration number. Compute the 500 OLS estimates βˆOLS
and plot them in a histogram. Comment.
(a.6) Redo part (a.5) two more times, first with T = 200, then with T = 500. Plot the three sampling
distributions of the OLS estimator in a histogram and comment.
Page 2 of 5
Computational Economics ECON 457 - A01
(b) We redo the analysis using a different Data Generating Process.
Set the sample size to T = 100. First consider two correlated error terms, vxt and v
y
t , drawn from a joint
normal distribution with zero means, unit variances, and correlation ρ = 0.7. As initial values, use vx0 = 0
and vy0 = 0. Generate the error terms for the explanatory variable (e
x
t ) and the error term for the dependent
variable (eyt ) using the following equations:
ext = 0.1v
x
t−1 + 0.7v
y
t−1 + v
x
t
eyt = 0.4v
x
t−1 + 0.3v
y
t−1 + v
y
t
Now we can generate xt and yt. As initial values, use x0 = 0. For every data point, you are asked to
generate the sample using the following model, setting the true parameter value to β = 0.7:
xt = xt−1 + ext
yt = βxt + e
y
t
(b.1) Compute the sample average and the sample standard deviation of both xt and yt. Comment.
(b.2) Compute the OLS estimate for βˆOLS . Comment.
(b.3) Now set the seed to a new value, using the formula:
seed=seed+100
Create the new values for xt and yt using the same procedure as above. Redo parts (b.1) and (b.2).
Comment.
(b.4) Now reset the seed to its original value, and set the sample size to T = 10, 000. Create the new
values for xt and yt using the same procedure as above. Redo parts (b.1) and (b.2). Comment on how the
results are affected by the sample size.
(b.5) Set the sample size to T = 100. Create 500 different datasets, using a do-loop and setting the seed
to seed=seed+iter, where iter stands for the iteration number. Compute the 500 OLS estimates βˆOLS
and plot them in a histogram. Comment.
(b.6) Redo part (b.5) two more times, first with T = 200, then with T = 500. Plot the three sampling
distributions of the OLS estimator in a histogram and comment.
Page 3 of 5
Computational Economics ECON 457 - A01
Question 2: Optimal Redistribution Policies (60 Marks)
In this question, we want to study the design of an optimal income taxation scheme, in a situation where
the tax revenues are only used to finance redistribution across different individuals.
Individuals differ in their ability, captured by the wages w that they can earn in their job (each individual
has only one job). These wages are log-normally distributed, with probability density function f(w) and
parameters µ and σ2: w ∼ LN(µ, σ2).
Suppose the agents maximize their utility, which depends on two goods: (disposable) income y and
leisure l. The utility function is denoted by u(y, l) and it is assumed to be Cobb-Douglas (with parameter
0 < η < 1):
u(y, l) = yηl1−η
Individuals have to allocate their time between leisure and hours worked h. In particular, we normalize
the total time endowment to 1, so that the time constraint is:
l + h = 1
In order to compare different policies, we use a simple “Social Welfare Function” (SWF). In particular, we
work with the average utility (which corresponds to the aggregate utility, as we are considering a population
size equal to 1):
SWF ≡ E [u(y, l)] =
∫ ∞
0
f(w)u(y(w), l(w))dw
Notice how income and leisure can potentially vary with the individuals’ wages, namely the notation
y(w) (l(w)) denotes that income (leisure) may depend on the agent’s ability.
(a) To start with, we consider a situation without a government, and with a fixed number of hours worked
h. In this case the individuals’ budget constraint is:
y(w) = wh
Compute the average utility in this economy, with different parameter values. In one case they are:
η = 0.5, σ2 = 0.5, µ = −σ2/2, h = 0.4.
In another case they are:
η = 0.5, σ2 = 0.8, µ = −σ2/2, h = 0.4.
In a final case they are:
η = 0.5, σ2 = 0.5, µ = −σ2, h = 0.4.
Explain how you solved this problem. Report your results in a table and comment on your findings.
(b) Now consider a government whose task is to select the proportional tax rate τ and the transfer T .
We are dealing with the so-called “flat-tax” fiscal system. All tax revenues R are rebated with a lump-sum
transfer, which represents a source of income that is not taxed. In this case the individuals’ budget constraint
is:
y(w) = (1− τ)wh+ T
The requirement that the government balances its budget implies that:
T = R =
∫ ∞
0
f(w)τwhdw
Compute numerically the optimal tax rate τ∗, namely the tax rate that maximizes the average utility:
Max
τ
SWF (τ) ≡ E [u(y(w), l(w))]
Page 4 of 5
Computational Economics ECON 457 - A01
Do so for different combinations of parameter values. In one case they are:
η = 0.5, σ2 = 0.5, µ = −σ2/2, h = 0.4.
In another case they are:
η = 0.5, σ2 = 0.8, µ = −σ2/2, h = 0.4.
In a final case they are:
η = 0.5, σ2 = 0.5, µ = −σ2, h = 0.4.
Explain how you solved this problem. Report your results in a table and comment on your findings.
(c) Repeat the exercise in part b, when the fiscal system is partially wasteful. The equilibrium value of
the transfer Tnew is lower than the total tax revenues R, and 0 < φ < 1 denotes a government efficiency
parameter:
Tnew = φR = φ
∫ ∞
0
f(w)τwhdw
In this case the individuals’ budget constraint is:
y(w) = (1− τ)wh+ Tnew
Compute numerically the optimal tax rate τ∗, namely the tax rate that maximizes the average utility:
Max
τ
SWF (τ) ≡ E [u(y(w), l(w))]
Do so for different combinations of parameter values. In one case they are:
φ = 0.5, η = 0.5, σ2 = 0.5, µ = −σ2/2, h = 0.4.
In another case they are:
φ = 0.5, η = 0.5, σ2 = 0.8, µ = −σ2/2, h = 0.4.
In a final case they are:
φ = 0.5, η = 0.5, σ2 = 0.5, µ = −σ2, h = 0.4.
Report your results in a table and comment on your findings.
(d) Repeat the exercise in part c, when the number of hours worked is no longer fixed. Instead, every
individual is now free to choose the hours worked that maximize their utility, h∗(w). In this case the
individuals’ budget constraint is:
y(w) = (1− τ)wh(w) + Tnew
The requirement that the government balances its budget implies that:
Tnew = φR = φ
∫ ∞
0
f(w)τwh(w)dw
Compute numerically the optimal tax rate τ∗, namely the tax rate that maximizes the average utility:
Max
τ
SWF (τ) ≡ E [u(y(w), l(w))]
Do so for different combinations of parameter values. In one case they are:
φ = 0.5, η = 0.5, σ2 = 0.5, µ = −σ2/2.
In another case they are:
φ = 0.5, η = 0.5, σ2 = 0.8, µ = −σ2/2.
In a final case they are:
φ = 0.5, η = 0.5, σ2 = 0.5, µ = −σ2.
Explain how you solved this problem. Report your results in a table and comment on your findings.
END OF THE EXAM
Page 5 of 5
学霸联盟