Assignment 6
Due date: 25 March 2025, 23h59
Directives
You must submit your assignmemnt in a pdf file using RMarkdown . Only submit the pdf file, NOT the RMarkdown file. To submit your pdf file, use the following format FamilyName__StudentNo,for example Nadeau__123456.pdf
To compile your pdf file, you can either knitr your file directly in pdf format. However, if you encounter difficulties generating a pdf file directly, you can also knitr your file in word first, then save as a pdf file.
Question 1 - Interprovincial trade
The file provtrade.txt contains data for interprovincial and international trade for Canada as a whole and for each of its province/territory, for the years 2010 to 2021. The data are in 000’s of dollars, ie you need to multiply the data by 1000 to get the actual number. For this question, ignore the line international re-exports.
a) For the years 2010 to 2021, calculate Canada’s average international trade balance (international exports - international imports). Was Canada a net importer or a net exporter of goods and services, on average, during this period? (2pts)
Hint: you will most likely need the function as.numeric() to force R to treat the data as numbers! For example, if x is a vector of data and you want to calculate its average, you might need to do mean(as.numeric(x)) to do the calculations.
b) From the data, you should have noticed that when considering Canada as a whole interprovincial exports and interprovincial imports are equal every year. Why, when considering Canada as a whole, is the interprovincial trade balance always equal to zero? (2pts)
c) Identify the provinces and territories that, on average over the period 2010-2021, were net international exporters and those that were net international importers. (13pts)
d) Identify the provinces and territories that, on average over the period 2010-2019, were net interprovincial exporters and those that were net interprovincial importers. (13pts)
For the following question, use the database provgdp.txt which contains the provincial and territorial GDP for the years 2019 to 2021. The data are in millions of dollars, ie you need to multiply the data by 1,000,000 to obtain the actual number.
e) In the model of the Canadian federation seen in class, we modeled a region’s imports as a share μ of its GDP. For the year 2019 and 2021, calculate for each province and territory the ratio of interprovincial imports relative to the provincial/territorial GDP. Keep only 4 decimals. Which are the 4 most import intensive provinces/territories, as a % of their GDP in 2019 and 2021?. Can you intuitively rationalize why?(15pts)
Question 2 - Model of interprovincial trade
Assume the following model of the Canadian federation, with AB representing Alberta, ON representing Ontario and QC representing Quebec.
reg_eqs <- sfcr_set(
Y_AB ~ C_AB + G_AB + X_AB - M_AB,
Y_ON ~ C_ON + G_ON + X_ON - M_ON,
Y_QC ~ C_QC + G_QC + X_QC - M_QC,
Y ~ Y_AB + Y_ON + Y_QC,
M_AB_ON ~ mu_AB_ON * Y_AB,
M_AB_QC ~ mu_AB_QC * Y_AB,
M_AB ~ M_AB_ON + M_AB_QC,
M_ON_AB ~ mu_ON_AB * Y_ON,
M_ON_QC ~ mu_ON_QC * Y_ON,
M_ON ~ M_ON_AB + M_ON_QC,
M_QC_AB ~ mu_QC_AB * Y_QC,
M_QC_ON ~ mu_QC_ON * Y_QC,
M_QC ~ M_QC_ON + M_QC_AB,
X_AB_ON ~ M_ON_AB,
X_AB_QC ~ M_QC_AB,
X_AB ~ X_AB_ON + X_AB_QC,
X_ON_AB ~ M_AB_ON,
X_ON_QC ~ M_QC_ON,
X_ON ~ X_ON_AB + X_ON_QC,
X_QC_AB ~ M_AB_QC,
X_QC_ON ~ M_ON_QC,
X_QC ~ X_QC_AB + X_QC_ON,
YD_AB ~ Y_AB - TX_AB + r[-1] * Bh_AB[-1],
YD_ON ~ Y_ON - TX_ON + r[-1] * Bh_ON[-1],
YD_QC ~ Y_QC - TX_QC + r[-1] * Bh_QC[-1],
TX_AB ~ theta * ( Y_AB + r[-1] * Bh_AB[-1] ),
TX_ON ~ theta * ( Y_ON + r[-1] * Bh_ON[-1] ),
TX_QC ~ theta * ( Y_QC + r[-1] * Bh_QC[-1] ),
V_AB ~ V_AB[-1] + ( YD_AB - C_AB ),
V_ON ~ V_ON[-1] + ( YD_ON - C_ON ),
V_QC ~ V_QC[-1] + ( YD_QC - C_QC ),
C_AB ~ alpha1_AB * YD_AB + alpha2_AB * V_AB[-1],
C_ON ~ alpha1_ON * YD_ON + alpha2_ON * V_ON[-1],
C_QC ~ alpha1_QC * YD_QC + alpha2_QC * V_QC[-1],
Hh_AB ~ V_AB - Bh_AB,
Hh_ON ~ V_ON - Bh_ON,
Hh_QC ~ V_QC - Bh_QC,
Bh_AB ~ V_AB * ( lambda0_AB + lambda1_AB * r - lambda2_AB * ( YD_AB/V_AB ) ),
Bh_ON ~ V_ON * ( lambda0_ON + lambda1_ON * r - lambda2_ON * ( YD_ON/V_ON ) ),
Bh_QC ~ V_QC * ( lambda0_QC + lambda1_QC * r - lambda2_QC * ( YD_QC/V_QC ) ),
TX ~ TX_AB + TX_ON + TX_QC,
G ~ G_AB + G_ON + G_QC,
Bh ~ Bh_AB + Bh_ON + Bh_QC,
Hh ~ Hh_AB + Hh_ON + Hh_QC,
Bs ~ Bs[-1] + ( G + r[-1] * Bs[-1] ) - ( TX + r[-1] * Bcb[-1] ),
Hs ~ Hs[-1] + Bcb - Bcb[-1],
Bcb ~ Bs - Bh,
redondant ~ Hs - Hh
)
The calibration of the parameters and of the exogenous variables is as follow
reg_ext <- sfcr_set(
r ~ 0.035,
G_AB ~ 25,
G_ON ~ 25,
G_QC ~ 25,
mu_AB_ON ~ 0.15,
mu_AB_QC ~ 0.15,
mu_ON_AB ~ 0.15,
mu_ON_QC ~ 0.15,
mu_QC_AB ~ 0.15,
mu_QC_ON ~ 0.15,
alpha1_AB ~ 0.8,
alpha1_ON ~ 0.7,
alpha1_QC ~ 0.6,
alpha2_AB ~ 0.2,
alpha2_ON ~ 0.3,
alpha2_QC ~ 0.4,
lambda0_AB ~ 0.67,
lambda0_ON ~ 0.67,
lambda0_QC ~ 0.67,
lambda1_AB ~ 0.05,
lambda1_ON ~ 0.05,
lambda1_QC ~ 0.05,
lambda2_AB ~ 0.01,
lambda2_ON ~ 0.01,
lambda2_QC ~ 0.01,
theta ~ 0.25
)
Simulate the model for 200 périods, starting from zero. If you have done this right, you should find that at the initial steady state,
## Y_AB état stationnaire = 105 .6004
## Y_ON état stationnaire = 105 .6004
## Y_QC état stationnaire = 105 .6004
a) In the initial calibration, we have that α1(a)b = 0.8, α2(ab) = 0.2,α1(o)n = 0.7, α2(on) = 0.3 and α1(q)c = 0.6, α2(qc) = 0.4.
Despite these differences, you should find that at the initial steady state, all 3 provinces are perfectly identical/symmetrical. How do you explain this? (2 pts)
Let us call µi(j) the proposensity of province i to import from province j.
b) We now assume that µab(on) = 0.2, µab(qc) = 0.1, µon(ab) = µon(qc) = 0.15 and µqc(on) = 0.175, µqc(ab) = 0.125. Find Yab , Yon
and Y qc at the new steady state. Use the functions sfcr_set() and sfcr_shock() with start = 3, end = 100, to simulate the shock. Which province(s) experience an increase in GDP? Which province(s) see its GDP fall? How do you explain this result?(2 pts)
c) At the new steady state, calculate the bi-lateral trade balance of each province against all the other provinces. Also calculate the aggregate provincial trade balance. Report your results. (9 pts)
d) You should find in c) that at the new steady state, Québec has a trade surplus with Ontario. How do you explain this finding, given that Quebec’s propensity to import from Ontario is higher than Ontario’s
propensity to import from Québec, ie µqc(on) > µon(qc)?(2 pts)
e) At the new steady state, is the aggregate trade balance of Canada as a whole in equilibrium (ie = 0)? How do you explain this result?(2 pts)
f) At the new steady state, calculate the surplus/deficit of the Federal government in each province. Do we observe «twin surplus/deficit» in each province?(5 pts)
g) Start again from the steady state obtained with the initial calibration of the model. Assume now that
µab(on) = 0.1, µab(qc) = 0.2, µqc(on) = 0.2, µqc(ab) = 0.1, µon(ab) = 0.2 and µon(qc) = 0.1. Find Yab , Yon and Y qc at the new
steady state. Use the functions sfcr_set() and sfcr_shock() with start = 3, end = 100, to simulate this shock. Which province(s) observe an increase in its GDP? Which province(s) see its GDP fall? Is this result different from what you found in b)? If so, how do you explain this difference?(5 pts)
h) At the new steady state, calculate the bi-lateral trade balance of each province against all the other provinces. Also calculate the aggregate provincial trade balance. Report your results. Are there provinces for which the aggregate trade balance is in surplus? In deficit? Is this result different from what you found in c)? If so, how do you explain this difference?(13 pts)