Macroeconomic Theory III. 3 questions completed in R studio

Administration Due Date: 20 December 2023, 11h59 Format: • 1 final exam per student. • Submit the R script used to do the various graphs and calculations. • Insert your answers as comments in the R file you submit. • To submit your R file, use the format FAMILYNAMESTUDENTNUMBER, for example Nadeau1234567 Question 1 – Modèle de commerce interprovincial Let the following model of the Canadian federation, where AB represents Alberta, ON represents Ontario and QC represents Québec. In this model, in addition to purchasing goods and services in all provinces (G_AB, G_ON, G_QC), the Federal government runs an equalization program that provides additional payments only to provinces that are poorer than the Canadian average, ie the provincial GDP is lower than the average GDP 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, 1 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] + EQZ_AB, YD_ON ~ Y_ON – TX_ON + r[-1] * Bh_ON[-1] + EQZ_ON, YD_QC ~ Y_QC – TX_QC + r[-1] * Bh_QC[-1] + EQZ_QC, 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 ), Bh_ON ~ V_ON * ( lambda0_ON + lambda1_ON * r ), Bh_QC ~ V_QC * ( lambda0_QC + lambda1_QC * r ), 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 + EQZ_CA + r[-1] * Bs[-1] ) – ( TX + r[-1] * Bcb[-1] ), Hs ~ Hs[-1] + Bcb – Bcb[-1], Bcb ~ Bs – Bh, AVGY ~ Y/3, # Moyenne Canadienne / Canadian Average zeta_AB ~ if ( Y_AB[-1]-AVGY[-1] <0 ) {1} else {0}, zeta_ON ~ if ( Y_ON[-1]-AVGY[-1] <0 ) {1} else {0}, zeta_QC ~ if ( Y_QC[-1]-AVGY[-1] <0 ) {1} else {0}, EQZ_AB ~ -zeta_AB*rho_eqz*(Y_AB[-1]-AVGY[-1]), EQZ_ON ~ -zeta_ON*rho_eqz*(Y_ON[-1]-AVGY[-1]), EQZ_QC ~ -zeta_QC*rho_eqz*(Y_QC[-1]-AVGY[-1]), EQZ_CA ~ EQZ_AB + EQZ_ON + EQZ_QC, redondant ~ Hs – Hh ) 2 reg_ext <- sfcr_set( r ~ 0.045, G_AB ~ 50, G_ON ~ 50, G_QC ~ 50, rho_eqz ~ 0, mu_AB_ON ~ 0.2, mu_AB_QC ~ 0.2, mu_ON_AB ~ 0.2, mu_ON_QC ~ 0.2, mu_QC_AB ~ 0.2, mu_QC_ON ~ 0.2, alpha1_AB ~ 0.80, alpha1_ON ~ 0.60, alpha1_QC ~ 0.70, alpha2_AB ~ 0.20, alpha2_ON ~ 0.40, alpha2_QC ~ 0.30, lambda0_AB ~ 0.7, lambda0_ON ~ 0.7, lambda0_QC ~ 0.7, lambda1_AB ~ 0.08, lambda1_ON ~ 0.08, lambda1_QC ~ 0.08, theta ~ 0.30 ) In this model, mu_i_j is the propensity of province i to import from province j. For example, mu_ON_QC is Ontario’s propensity to import goods and services from Québec. a) (3 pts) Simulate this model, starting from zero, for 100 periods. What is the steady state value of GDP in each province? b) (1 pts) What is Canada’s consumption at this steady state? c) (3 pts) Assume now that the government of Canada decides to increase its spending in Alberta (G_AB) by 10% relative to its current spending. Using sfcr_shock(), with start = 3 and end = 50, simulate the impact of this fiscal policy. Plot the Canadian GDP following this fiscal policy, in % deviation from the initial steady state found in a). Use only observations 1 to 10 of your simulation to draw the graph. d) (3 pts) Assume instead that the government of Canada decides to increase its spending in Ontario (G_ON) by 10% relative to its current spending. Using sfcr_shock(), with start = 3 and end = 50, simulate the impact of this fiscal policy. Plot the Canadian GDP following this fiscal policy, in % deviation from the initial steady state found in a). Use only observations 1 to 10 of your simulation to draw the graph. e) (2 pts) If we only consider observations 1 to 6 of the simulations obtained using sfcr_shock(), does Canadian GDP increase by the same amount in c) and d)? How do you explain this result, consideraing that 3 the increase in total government spending on goods and services is the same in c) and d)? f) (2 pts) On the same graph, plot the GDP of each province, as well as the Canadian average (AVGY) following the fiscal spending shock in Ontario. Based on your understanding of the model, which province(s) should receive and equalization payment (EQZ_j) from the government, following the increase in government spending in Ontario? g) (1 pts) Which parameter of the model determines whether or not the government provides equalization payments to provinces? h) (2 pts) Answer again question d), but this time ensuring that the parameter identified in g) takes on the value of 1. i) (3 pts) Plot on the same graph the evolution of Ontario GDP as found in d) and h), using once again only the first 10 observations of your simulations. What is the impact of equalization payments on Ontario GDP? How do you explain this, given that in both simulations, Ontario NOT receive equalization payments? Question 2 – Model of international trade Let the following model of international trade between Canada and the United States (US). This is a simple extension of the model seen in class. In this version, however, Canadian households can hold US government bills, and US households can hold Canadian government bills. Thus, Bh_CA_CA represents Canadian government bills held by Canadian households and Bh_CA_US are US government bills held by Canadian households. These amounts are expressed in Canadian dollars. Similarly, Bh_US_CA are Canadian government bills held by US households and Bh_US_US are US government bills held by US households. These amounts are expressed in US dollars. Also, Bs_US_CA are bills that the Canadian government sold to US households. This amount is expressed in Canadian dollar. For the model to be consistent, it has to be the case that Bs_US_CA ~ Bh_US_CA / xr. Similarly, Bs_CA_US are bills that the US government sold to Canadian households. This amount is expressed in US dollars. For the model to be consistent, it has to be the case that Bs_CA_US ~ Bh_CA_US * xr. open_eqs <- sfcr_set( eq1 = Y_CA ~ C_CA + G_CA + X_CA – M_CA, eq2 = Y_US ~ C_US + G_US + X_US – M_US, eq3 = M_CA ~ mu_CA * Y_CA, eq4 = M_US ~ mu_US * Y_US, eq5 = X_CA ~ M_US / xr, eq6 = X_US ~ M_CA * xr, eq7 = YD_CA ~ Y_CA + r_CA[-1] * Bh_CA_CA[-1] + r_US[-1] * Bs_CA_US[-1] / xr – TX_CA, eq8 = YD_US ~ Y_US + r_CA[-1] * Bs_US_CA[-1] * xr + r_US[-1] * Bh_US_US[-1] – TX_US, eq9 = TX_CA ~ theta_CA * ( Y_CA + r_CA[-1] * Bh_CA_CA[-1] + r_US[-1] * Bs_CA_US[-1] / xr ), eq10 = TX_US ~ theta_US * ( Y_US + r_CA[-1] * Bs_US_CA[-1] * xr + r_US[-1] * Bh_US_US[-1] ), eq11 = CG_CA ~ Bs_CA_US[-1] * (1/xr – 1/xr[-1]), eq12 = CG_US ~ Bs_US_CA[-1] * (xr – xr[-1]), eq13 = V_CA ~ V_CA[-1] + ( YD_CA – C_CA ) + CG_CA, eq14 = V_US ~ V_US[-1] + ( YD_US – C_US ) + CG_US, eq15 = C_CA ~ alpha1_CA * YD_CA + alpha2_CA * V_CA[-1], eq16 = C_US ~ alpha1_US * YD_US + alpha2_US * V_US[-1], eq17 = Hh_CA ~ V_CA – Bh_CA_CA – Bh_CA_US, eq18 = Hh_US ~ V_US – Bh_US_CA – Bh_US_US, eq19 = Bh_CA_CA ~ V_CA * ( lambda20_CA + lambda22_CA * r_CA + lambda23_CA * r_US ), eq20 = Bh_CA_US ~ V_CA * ( lambda30_CA + lambda32_CA * r_CA + lambda33_CA * r_US ), eq21 = Bh_US_CA ~ V_US * ( lambda20_US + lambda22_US * r_CA + lambda23_US * r_US ), eq22 = Bh_US_US ~ V_US * ( lambda30_US + lambda32_US * r_CA + lambda33_US * r_US ), 4 eq23 = Bs_CA ~ Bs_CA[-1] + ( G_CA + r_CA[-1] * Bs_CA[-1] ) – ( TX_CA + r_CA[-1] * Bcb_CA[-1] ), eq24 = Bs_US ~ Bs_US[-1] + ( G_US + r_US[-1] * Bs_US[-1] ) – ( TX_US + r_US[-1] * Bcb_US[-1] ), eq25 = Bs_CA_US ~ Bh_CA_US * xr, eq26 = Bs_US_CA ~ Bh_US_CA / xr, eq27 = Bcb_CA ~ Bs_CA – Bh_CA_CA – Bs_US_CA, eq28 = Bcb_US ~ Bs_US – Bs_CA_US – Bh_US_US, eq29 = or_CA ~ or_CA[-1] + ( Hs_CA – Hs_CA[-1] – ( Bcb_CA – Bcb_CA[-1] ) )/pg_CA, eq30 = or_US ~ or_US[-1] + ( Hs_US – Hs_US[-1] – ( Bcb_US – Bcb_US[-1] ) )/pg_US, eq31 = Hs_CA ~ Hh_CA, eq32 = Hs_US ~ Hh_US, eq33 = xr ~ pg_US / pg_CA, eq34 = deltaor_US ~ or_US – or_US[-1], eq35 = deltaor_CA ~ or_CA – or_CA[-1], eq36 = CAB_CA ~ X_CA – M_CA + r_US[-1] * Bs_CA_US[-1] * xr – r_CA[-1] * Bs_US_CA[-1], eq37 = CAB_US ~ X_US – M_US – r_US[-1] * Bs_CA_US[-1] + r_CA[-1] * Bs_US_CA[-1] / xr, eq38 = FAB_CA ~ -(deltaor_CA*pg_CA + (Bs_CA_US – Bs_CA_US[-1])*xr – (Bs_US_CA – Bs_US_CA[-1])), eq39 = FAB_US ~ -(deltaor_US*pg_US + (Bs_US_CA – Bh_US_CA[-1])/xr – (Bs_CA_US – Bh_CA_US[-1])), eq40 = BOP_CA ~ CAB_CA + FAB_CA, eq41 = BOP_US ~ CAB_US + FAB_US, eq42 = GDEF_CA ~ -(Bs_CA – Bs_CA[-1]), eq43 = GDEF_US ~ -(Bs_US – Bs_US[-1]), eq44 = redondant ~ deltaor_US + deltaor_CA ) open_ext <- sfcr_set( pg_CA ~ 1.0, pg_US ~ 1.0, r_CA ~ 0.04, r_US ~ 0.04, orbar_CA ~ 100, orbar_US ~ 100, G_US ~ 50, G_CA ~ 50, mu_CA ~ 0.15, mu_US ~ 0.15, alpha1_CA ~ 0.8, alpha1_US ~ 0.8, alpha2_CA ~ 0.2, alpha2_US ~ 0.2, lambda20_CA ~ 0.55, lambda30_CA ~ 0.25, lambda20_US ~ 0.25, lambda30_US ~ 0.55, lambda22_CA ~ 5, lambda23_CA ~ -3, lambda32_CA ~ -3, lambda33_CA ~ 5, lambda22_US ~ 5, lambda23_US ~ -3, lambda32_US ~ -3, lambda33_US ~ 5, theta_CA ~ 0.2, theta_US ~ 0.2, 5 ) open_initial <- sfcr_set( xr ~ 1, or_CA ~ 100, or_US ~ 100 ) Simulate this model for 200 periods, using the initial values provided in open_initial. You should find that at the steady state, ## Y_CA at steady state = 286.2949 ## Y_US at steady state = 286.2949 a) (1 pts) Given the available information, is the exchance rate xrt quoted as 1) the number of US dollars needed to by 1 Canadian dollar or 2) the number of Canadian dollars needed to buy 1 US dollar? b) (2 pts) Explain the meaning of parameters lambda20_CA and lambda30_CA. Similarly, explain the meaning of parameters lambda20_US and lambda30_US. c) (1 pts) In the initial calibration, we see that lambda20_CA is greater than lambda30_CA and that lambda30_US is greater than lambda20_US. Intuitively, explain why this is a reasonnable calibration. d) (3 pts) At the steady state, determine the share of their wealth that Canadian households hold in 1) Canadian government bills (Bh_CA_CA), 2) US government bills (Bh_CA_US) and 3) money (Hh_CA). e) (3 pts) At the steady state, determine the share of their wealth that US households hold in 1) Canadian government bills (Bh_US_CA), 2) US government bills (Bh_US_US) and 3) money (Hh_US). Assume that the US central bank increases its policy interest rate from 4% to 5%. Use the functions sfcr_set() and sfcr_shock() with start = 3, end = 100, to simulate this shock. f) (3 pts) On the same graph, plot the response of Canada and US consumption to this shock. Plot your variables as % deviation from their initial steady state. Which country experiences the largest change in consumption? g) (6 pts) On the same graph, plot Bh_CA_CA and Bh_CA_US. On another graph, plot Bh_US_CA et Bh_US_US. Which government bills experiences an increase in demand? Which government bills experiences a decline in demand? How do you explain this? Assume now an alternative calibration whereby lambda20_CA = lambda30_CA = lambda20_US = lambda30_US ~ 0.4. All the other parameters remain unchanged. h) (8 pts) Simulate this model for 200 periods, starting from zero, but using the alternative calibration. At the steady state, find the share of their wealth that Canadian households hold in 1) Canadian government bills (Bh_CA_CA), 2) US government bills (Bh_CA_US) and 3) money (Hh_CA). Do the same for the share of their wealth that US households hold in 1) Canadian government bills (Bh_US_CA), 2) US government bills (Bh_US_US) and 3) money (Hh_US). i) (6 pts) Find Y_CA and Y_US at the steady state of this alternative model. Is it different from the one obtained with the initial calibration? How do you explain this result, considering your findings from questions 3d), 3e) and 3h)? Simulate again the shocks whereby the US central bank increases its policy interest rate from 4% to 5%, using the alternative model. Use the functions sfcr_set() and sfcr_shock() with start = 3, end = 100, to simulate this shock. i) (5 pts) On the same graph, plot 1) the response of Canada’s consumption following the monetary policy shock using the initial model and 2) the response of Canada’s consumption following the monetary policy 6 shock using the alternative model. Plot your variables as % deviation from their initial steady state. Is the response of consumption different between the two models, even though the monetary policy shock is the same? How can you explain this? Which lesson does this experiment hold in terms of diversification of your portfolio of financial assets? Question 3 – Model with real and nominal variables Assume the following model, a modified version of the model pcnom.R with price and wage rigidity seen in class. pcfisc_eqs <- sfcr_set( eq1 = Y ~ C + G, eq2 = Yn ~ Y * P, eq3 = N ~ Y / prod, eq4 = W ~ xi_w*W[-1] + (1-xi_w)*(w0 + w1*(exp(100*(N/N_fe-1))-1)), eq5 = Wn ~ W*P, eq6 = WB ~ Wn * N, eq7 = Profits ~ Yn – WB, eq8 = UCn ~ WB / Y, eq9 = P ~ xi_p*P[-1]+(1-xi_p)*(1+markup)*UCn, eq10 = Pi ~ (P/P[-1]-1), eq11 = YDn ~ WB + Profits + r[-1] * Bh[-1] – TX, eq12 = YD ~ YDn / P, eq13 = TX ~ theta * (WB + Profits + r[-1] * Bh[-1]), eq14 = Vn ~ Vn[-1] + YDn – Cn, eq15 = V ~ Vn / P, eq16 = C ~ alpha1 * YD + alpha2 * V[-1], eq17 = Cn ~ C * P, eq18 = Hh ~ Vn – Bh, eq19 = Bh ~ Vn * (lambda0 + lambda1 * r – lambda2 * ( YDn/Vn )), eq20 = Bs ~ Bs[-1] + (Gn + r[-1] * Bs[-1]) – (TX + r[-1] * Bcb[-1]), eq21 = Gn ~ (1-fiscsw)*((1-rhog)*Gnbar + rhog*Gn[-1]) + fiscsw*(Gnbar+e_gn), eq22 = G ~ Gn / P, eq23 = Hs ~ Hs[-1] + Bcb – Bcb[-1], eq24 = Bcb ~ Bs – Bh, eq25 = r ~ rbar, eq26 = redondant ~ Hs – Hh, ) The file final2023_codeR_Q3.R includes the code required to simulate the model. You must copy this code in your R file and simulate it completely to be able to answer question 3. a) (3 pts) Which parameter of the model captures the degree of price rigidity? Which parameter captures the degree of wage rigidity? As calibrated, does the model contain 1) price rigidity only, 2) wage rigidity only or 3) both price and wage rigidity? b) (3pts) It is generally acknowledged that increases in producitivity is crucial to achieve better standards of living. Using sfcr_shock, simulate the impact of a 1% increase in productivity (prod). Use start = 3 and end = 100. Simulate the shock for 100 periods. Plot the evolution of the price level in % deviation from initial steady state. Use only the first 40 observations of the simulation to draw the graph. c) (3 pts) On the same graph, plot (in % deviation from the initial steady state), the evolution of the real wage, the nominal wage and the unit cost of production. Use only the first 40 observations of the simulation to draw the graph. d) (1 pts) Given your findings in b) and c), How do you explain the impact of the productivity increase on the price level? 7 e) (3 pts) On the same graph, plot (in % deviation from the initial steady state), the evolution of the real AND nominal consumption. Use only the first 40 observations of the simulation to draw the graph. Given this graph, would you agree that the increase in productivity improve households’ standards of living? Briefly explain your reasoning. Assume now that the increase in productivity takes place at the same time as a pandemic decimates the workforce of the economy, so that N_fe, the full employment level, drops simultaneously by 1.625%. f) (4 pts) Using sfcr_shock, simulate the impact of the 1% increase in productivity (prod) AND the simultaneous decline in full employment (N_fe) of 1.625%. Use start = 3 and end = 100. Simulate the shock for 100 periods. Plot the evolution of the price level (in % deviation from initial steady state). On the same graph, also plot the evolution of the price level (in % deviation from initial steady state) that you obtained in question b).Use only the first 40 observations of the simulation to draw the graph. How do you explain the difference between what you find in f) and what you found in b)? g) (3 pts) On the same graph, plot (in % deviation from the initial steady state), the evolution of the real AND nominal consumption following your simulation in f). Use only the first 40 observations of the simulation to draw the graph. In your opinion, what would have happened to real consumption if, following the decline of 1.625% in N_fe, productivity HAD NOT increased by 1%? Explain intuitively your reasoning.

Click here to order similar paper @Udessaywriters.com.100% Original.Written from scratch by professional writers.

You May Also Like

About the Author: admin