% Matlab File: plotimpendowment.m % Chapter 1. The basic model % One good, endownment model with perfect capital mobility % June 2007 % This program is part of the book "Open Economy Macroeconomics in % Developing Countries" (forthcoming MIT Press) by Carlos A. Vegh. Use of % this program or modifications thereof should be acknowledged by citing % this manuscript. This program is a modification of the original % King, Plosser, and Rebelo's (1988) programs. I am grateful to Guillermo % Vuletin for his help in writing this program. % For temporary shocks, this program is to be used after pathendowment.m % For permanent shocks, this program will be automatically used by % implendowment.m % Order of variables is: %States, exogenous, co-states, controls, and flows % Date a y lambda c TB % 1 2 3 4 5 6 % Program was modified to include the zero value in period zero % in the plot % clg % time = 1:nir; time = 0:nir; [dim1 dim2]=size(IR); PIR = [zeros(1,dim2) IR]; figure(1) subplot(221), plot(time,PIR(:,3),'-',time,zeros(size(time)),'.') title('Endowment') xlabel('time') subplot(222), plot(time, PIR(:,5),time,zeros(size(time)),'.') title('Consumption') xlabel('time') subplot(223), plot(time,PIR(:,2),time,zeros(size(time)),'.') title('Net foreign assets') xlabel('time') subplot(224), plot(time,PIR(:,6),time,zeros(size(time)),'.') title('Trade balance') xlabel('time') clear time subplot