% USA_Model2_komplet.m % ************* % PART 3: M U L T I - E Q U A T I O N S M O D E L S % 13.3 Simulation Example % ============================================================== % Robert S. Pindyck & Daniel L. Rubinfeld % Econometric Models & Economic Forecast, 4/e % McGraw-Hill, 1998 % ISBN 0-07-050208-0 % % Data to accompany Econometric Models & Economic Forecast, 4/e % (c) Irwin/McGraw-Hill, 1998 % Disk 1 of 1 % ISBN 0-07-848043-4 % ============================================================== clear all; close all; clc; %data ulozena v textovem souboru USAmacro.dat load USAmacro.dat; maxl = 4; %maximalni zpozdeni v modelu last = 0; %pocet poslednich vynechanych hodnot t = USAmacro(maxl+1:end-last,1); % Ctvrtleti od 2Q1950-1Q1988 n = length(t); %endogeni promenne C = USAmacro(maxl+1:end-last,2); % Realna agregatni osobni potreba (v cenach roku 1982) [mld.] I = USAmacro(maxl+1:end-last,3); % Realne hrube domaci investice (v cenach roku 1982) [mld.] R = USAmacro(maxl+1:end-last,4); % Urokova sazba 3 mesicnich Treasury bill [% p.a.] Y = USAmacro(maxl+1:end-last,5); % Realny HDP (ocisten o exporty a importy; v cenach 1982) [mld.] %zpozdene endogenni promenne C_1 = USAmacro(maxl+1-1:end-last-1,2); %Zpozdene C(t-1) Y_1 = USAmacro(maxl+1-1:end-last-1,5); %... dY_1 = USAmacro(maxl+1-1:end-last-1,5)-USAmacro(maxl+1-2:end-last-2,5); %Y(t-1)-Y(t-2) R_4 = USAmacro(maxl+1-4:end-last-4,4); sumR_1 = USAmacro(maxl+1-1:end-last-1,4)+USAmacro(maxl+1-2:end-last-2,4); %R(t-1)+R(t-2) %exogenni promenne konst = ones(n,1); G = USAmacro(maxl+1:end-last,6); % Realne vladni vydaje (v cenach roku 1982) [mld.] dM = USAmacro(maxl+1:end-last,7)-USAmacro(maxl+1-1:end-last-1,7); % Zmena realne penezni zasoby (M1) [mld.] %dalsi endogenni promenne dY = Y-Y_1; %Y(t)-Y(t-1) %pomocne exogenni promenne M = USAmacro(maxl+1:end-last,7); %penezni zasoba - agregat M1 %graficke zobrazeni endogennich promennych figure set(gcf,'Name',' Endogenous variables'); subplot(2,2,1) hndl2=plot(t,C); set(hndl2,'LineWidth',2); title('Real Aggregate Personal Consumption'); ylabel('C [ billions of 1982 dolars ]'); xlabel('Time [ quarter ]'); grid subplot(2,2,2) hndl3=plot(t,I); set(hndl3,'LineWidth',2); title('Real Gross Domestic Investment'); ylabel('I [ billions of 1982 dolars ]'); xlabel('Time [ quarter ]'); grid subplot(2,2,3) hndl4=plot(t,R,'r'); set(hndl4,'LineWidth',2); title('Interest Rate on 3-Month Treasury Bills'); ylabel('R [ percent per year ]'); xlabel('Time [ quarter ]'); grid subplot(2,2,4) hndl5=plot(t,Y,'r'); set(hndl5,'LineWidth',2); title('Real GNP (net export and import)'); ylabel('Y [ billions of 1982 dolars ]'); xlabel('Time [ quarter ]'); grid %graficke zobrazeni exogennich promennych figure set(gcf,'Name',' Exogenous variables'); subplot(2,1,1) hndl6=plot(t,G,'r'); set(hndl6,'LineWidth',2); hold off title('Real Gavernment Spending'); ylabel('G [ billions of 1982 dolars'); xlabel('Time [ quarter ]'); grid subplot(2,1,2) hndl7=plot(t,M,'r'); set(hndl7,'LineWidth',2); hold off title('Real Money Stock M1'); ylabel('M [ billions of 1982 dolars ]'); xlabel('Time [ quarter ]'); grid